(self)
| 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 |
nothing calls this directly
no test coverage detected