MCPcopy Create free account
hub / github.com/pytorch/tutorials / hvp

Function hvp

intermediate_source/jacobians_hessians.py:326–327  ·  view source on GitHub ↗
(f, primals, tangents)

Source from the content-addressed store, hash-verified

324from torch.func import jvp, grad, vjp
325
326def hvp(f, primals, tangents):
327 return jvp(grad(f), primals, tangents)[1]
328
329#######################################################################
330# Here's some sample usage.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected