It depends on your coding style, but it should be called before loss.backward() in case you don’t want explicitly to accumulate the gradients (which is a valid use case, but not the usual work flow).
I personally try to add it right at the beginning of the training loop, since I think I remember it better, but I still forget it from time to time.