You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think optimizer.zero_grad() should go before loss.backward() to ensure that gradients are zeroed out before the calculation of the gradients that takes place inside loss.backward().