Hello
It’s general question but currently I’m looking at tutorial:
http://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html 978
why in optimize_model function - we have
detach() method
and in select_action we use
with torch.no_grad():
on the other hand doc:
http://pytorch.org/docs/stable/notes/autograd.html 1.1k
mentions only requires_grad
of course I understand we don’t want to compute gradients here - but i don’t fully understand the difference between all those 3 methods…
also If i’m not mistaken in previous versions of pytorch we used volatile=true which was considered more memory efficient (please correct me if i’m wrong) which is now replaced by with torch.no_grad():
so if we used with torch.no_grad(): in optimize_mode, would it be also ok?
could anyone please explain it to me?
thank you
best,
Michael