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

Method testTapeReset

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

Source from the content-addressed store, hash-verified

404 self.assertEqual(t.gradient(z, x2).numpy(), 4.0)
405
406 def testTapeReset(self):
407 with backprop.GradientTape() as t:
408 v = resource_variable_ops.ResourceVariable(1.0)
409 loss = v * v
410 t.reset()
411 loss += v * v
412 self.assertAllEqual(t.gradient(loss, v), 2.0)
413
414 def testPythonMax(self):
415 x = [resource_variable_ops.ResourceVariable(2.),

Callers

nothing calls this directly

Calls 5

gradientMethod · 0.80
GradientTapeMethod · 0.45
ResourceVariableMethod · 0.45
resetMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected