which one is used when?
https://pytorch.org/docs/stable/optim.html 22  here it uses Optimizer.zero_grad()
https://github.com/pytorch/examples/blob/master/dcgan/main.py 20 codes here use NetG.zero_grad().
I know that optimizer.zero_grad() makes the existing gradients zero before backpropagating the loss. Then update network parameters. What is nn.Module.zero_grad() used for?