Closed
Description
Repro:
[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.
Metadata
Metadata
Assignees
Labels
No labels