Get Dictionary of Gradient Values

If you model contains a parameter named model.param then you can access the gradients with respect to that parameter using model.param.grad.

1 Like