Namely it is a parameter of a Module and so will be returned by mod.parameters() call.

Thank you! Let me format the code and ask.



 albanD:

grads = autograd.grad(loss, model.parameters()) 


This is so helpful! Thank you @albanD .