Hello Forum!
I am, for whatever reason, attempting to convert a simple
pytorch-1.0.1 training script to pytorch version 0.3.0.
As far as I can tell, torch.no_grad() doesn’t exist in 0.3.0.
My use case is that (in the training loop) I run the model
(predict, based on my input data), and then do some sanity
checks and collect some statistics.  I wrap these latter two
in a with torch.no_grad(): block.  I don’t really understand
what I am doing (but it works …), but I suppose I avoid
cluttering up my graph with cruft (efficiency) and/or changing
the results of calling loss.backward() (correctness).
What should I do in 0.3.0?  Can I just leave out the
with torch.no_grad() (because my additional calculations
come after calculating the loss, so the gradients won’t be
affected)?  Should I clone / detach any tensors I use in my
sanity / statistics calculations?  Is there something in 0.3.0
like no_grad() that I should be using (but with a different
name or semantics)?
Thanks for any help.
K. Frank