You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fact]
public void DetachedFromScopeCountNegative()
{
var stats = DisposeScopeManager.Statistics;
stats.Reset();
var t = torch.tensor(1);
Assert.Equal(0, stats.DetachedFromScopeCount);
var scope = torch.NewDisposeScope();
scope.Attach(t);
Assert.Equal(0, stats.DetachedFromScopeCount);
}
Removing the branch in DisposeScope.Attach(IEnumerable<IDisposable> disposables) that subtracts fixes the issue and all tests pass, minus any tests checking counts (waiting on PR #1386 prior to fixing.
The text was updated successfully, but these errors were encountered:
mvphelps
changed the title
Attaching unowner tensor to a DisposeScope makes Statistics.DetachedFromScopeCount go negative.
Attaching unowned tensor to a DisposeScope makes Statistics.DetachedFromScopeCount go negative.
Oct 18, 2024
mvphelps
added a commit
to mvphelps/TorchSharp
that referenced
this issue
Oct 23, 2024
Repro:
Removing the branch in
DisposeScope.Attach(IEnumerable<IDisposable> disposables)
that subtracts fixes the issue and all tests pass, minus any tests checking counts (waiting on PR #1386 prior to fixing.The text was updated successfully, but these errors were encountered: