PyTorch Forums
Model.zero_grad() or optimizer.zero_grad()?
Uncategorized
ritchieng
(Ritchie Ng)
October 31, 2018, 9:10am
3
If you’re referring to:
optimizer = optim.SGD(net.parameters())
They’re the same.
show post in topic