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

Method testAcceptsRefs

tensorflow/python/ops/math_ops_test.py:300–309  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

298
299 @test_util.run_in_graph_and_eager_modes
300 def testAcceptsRefs(self):
301 if context.executing_eagerly():
302 var = resource_variable_ops.ResourceVariable(10, name="var")
303 else:
304 var = variables.Variable(10)
305 result = math_ops.scalar_mul(3, var)
306 init = variables.global_variables_initializer()
307 with test_util.device(use_gpu=True):
308 self.evaluate(init)
309 self.assertEqual(30, self.evaluate(result))
310
311 @test_util.run_in_graph_and_eager_modes
312 def testAcceptsConstant(self):

Callers

nothing calls this directly

Calls 5

executing_eagerlyMethod · 0.80
VariableMethod · 0.80
ResourceVariableMethod · 0.45
deviceMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected