I found code like this:
opt.step()
opt.zero_grad()

and I also found code like this:
opt.zero_grad()
opt.step()

Which one would be more correct? Am I missing something obvious here?
I found this 3 answer helpful but still is it wrong to zero the grads after the step(), since possible we don’t need them anymore after the step().