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

Method testVariable

tensorflow/python/eager/function_test.py:145–151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 self.assertAllEqual(sq2.numpy().reshape(-1), [52, 76, 74, 108])
144
145 def testVariable(self):
146 v1 = variables.Variable(1.0)
147 add = def_function.function(lambda x, v: x + v1 + v)
148 v2 = variables.Variable(1.0)
149 x = constant_op.constant(1.0)
150 r = add(x, v2)
151 self.assertEqual(3.0, self.evaluate(r))
152
153 def testVariableOnly(self):
154 v = variables.Variable(1.0)

Callers

nothing calls this directly

Calls 5

VariableMethod · 0.80
addFunction · 0.50
functionMethod · 0.45
constantMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected