I am currently using Resnet50 and calculate the gradient w.r.t the input, which is something like:
grad_val = pred.backward(create_graph=True)
Then I use the grad to further calculate:
result = autograd.grad(grad_val, model.parameters())
I find that the last item of the result is always None. Normally, it should be the same shape as bias term, right?