torch.func.hessian
- torch.func.hessian(func, argnums=0)
Computes the Hessian of
funcwith respect to the arg(s) at indexargnumvia a forward-over-reverse strategy.The forward-over-reverse strategy (composing
jacfwd(jacrev(func))) is a good default for good performance. It is possible to compute Hessians through other compositions of and like or .