Has there been any update on this? That is, how to get the Hessian (even if just the diagonal) in Pytorch?
Would something like this work:
output = model.forward(input)
model.backward().backward()
hess = input.grad