Module.parameters().grad won’t work directly and you would have to create a list or iterate it:
for param in Module.parameters():
    print(param.grad)




 David_Alford:

And I should call optimizer.zero_grad() each epoch to clear the gradients so they don’t accumulate?


The usual workflow is to zero out the gradients after each iteration, if you don’t want to accumulate the gradients.



 David_Alford:

Doesnt matter where you call zero_grad()


As long as zero_grad() is not called after the backward() call and before optimizer.step(), it should be OK.



 David_Alford:

Also, what do you think is the area of PyTorch most people have trouble with? My focus is Computer Vision. Is there a concept/area in PyTorch that I can focus my energy on where you think people commonly make mistakes?


Do you mean here in the discussion board or in the general framework usage?