# tensorplay.func.hessian Source: https://www.tensorplay.cn/docs/generated/tensorplay.func.hessian.html ```python tensorplay.func.hessian(func: Callable, argnums: int | tuple[int, ...] = 0) ``` Returns a function computing the Hessian of func. Built as the reverse-mode jacobian of the reverse-mode gradient. The forward-over-reverse ordering would need tangents to flow through the backward pass itself, which this engine’s reverse mode does not carry; reverse-over-reverse composes two plain jacobians instead. Example ``` >>> def f(x): ... return x.sin().sum() >>> hess = hessian(f)(tensorplay.randn(5)) >>> hess.shape tensorplay.Size(5, 5) ```