MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _jvp

Function _jvp

tensorflow/python/eager/forwardprop_test.py:50–55  ·  view source on GitHub ↗

Compute the jacobian of `f` at `primals` multiplied by `tangents`.

(f, primals, tangents)

Source from the content-addressed store, hash-verified

48
49# TODO(allenl): Move this somewhere useful once forward gradients are stable.
50def _jvp(f, primals, tangents):
51 """Compute the jacobian of `f` at `primals` multiplied by `tangents`."""
52 with forwardprop.ForwardGradientAccumulator() as acc:
53 acc.watch(primals, tangents)
54 primals_out = f(*primals)
55 return primals_out, acc.jvp(primals_out)
56
57
58def _jacfwd(f, primals):

Callers 3

_jacfwdFunction · 0.85
_hvpFunction · 0.85
testJVPManualMethod · 0.85

Calls 3

jvpMethod · 0.80
fFunction · 0.50
watchMethod · 0.45

Tested by

no test coverage detected