-
Notifications
You must be signed in to change notification settings - Fork 53
-
Looking at https://github.com/dotnet/TorchSharpExamples/blob/main/tutorials/CSharp/tutorial6.ipynb
lines like this one: loss.forward(model.forward(dataBatch), resultBatch);
model.forward() returns tensor and you never do Dispose on it.
Or am i missing something?
my understanding that Tensor live in PyTorch library and will not put pressure on C# garbage collection.
line like this "model.forward(dataBatch).argmax(1)" in a loop 1000 times leaks 1000 tensors and GC will not know that it's time to collect them.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment