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

Method testGradient

tensorflow/compiler/tests/eager_test.py:158–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 self.assertEqual(3.0, val2.numpy())
157
158 def testGradient(self):
159 def f(x):
160 return x
161
162 with self.test_scope():
163 grad_fn = backprop.gradients_function(f)
164 self.assertAllEqual(2., grad_fn(1., dy=2.)[0])
165
166 def testVariableGradient(self):
167 with self.test_scope():

Callers

nothing calls this directly

Calls 3

grad_fnFunction · 0.50
test_scopeMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected