Solved by ptrblck in post #2 
              
              
                Once you’ve called backward to calculate the gradients, you can directly print them using something like this: 
model = nn.Sequential(
    nn.Linear(10, 2)
)
...
loss.backward()
print(model[0].weight.grad)

In your case the model definition will look a bit different. So depending how you’ve implemen…