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

Method testFetchSingleton

tensorflow/python/client/session_test.py:224–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

222 s.run({'a': a, 'b': None})
223
224 def testFetchSingleton(self):
225 with session.Session() as sess:
226 a = constant_op.constant(42.0)
227 res = sess.run(a)
228 self.assertEqual(42.0, res)
229 res = sess.run(a.op) # An op, not a tensor.
230 self.assertEqual(None, res)
231 tensor_runner = sess.make_callable(a)
232 res = tensor_runner()
233 self.assertEqual(42.0, res)
234 op_runner = sess.make_callable(a.op)
235 res = op_runner()
236 self.assertEqual(None, res)
237
238 def testFetchSingletonByName(self):
239 with session.Session() as sess:

Callers

nothing calls this directly

Calls 4

SessionMethod · 0.45
constantMethod · 0.45
runMethod · 0.45
make_callableMethod · 0.45

Tested by

no test coverage detected