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

Method testMakeVJP

tensorflow/python/eager/backprop_test.py:522–530  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

520
521 @test_util.assert_no_new_tensors
522 def testMakeVJP(self):
523
524 def f(x):
525 return x * x
526
527 wrapped_fn = backprop.make_vjp(f, persistent=False)
528 result, vjp = wrapped_fn(constant_op.constant(3.0))
529 self.assertAllEqual(result, 9.0)
530 self.assertAllEqual(vjp(2.0)[0], 12.0)
531
532 def testPersistentMakeVJP(self):
533

Callers

nothing calls this directly

Calls 4

wrapped_fnFunction · 0.85
vjpFunction · 0.85
constantMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected