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

Method testFetchTuple

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

Source from the content-addressed store, hash-verified

259 self.assertEqual([42.0, None, 44.0, 42.0, None], res)
260
261 def testFetchTuple(self):
262 with session.Session() as sess:
263 a = constant_op.constant(42.0)
264 b = control_flow_ops.no_op() # An op, not a tensor.
265 c = constant_op.constant(44.0)
266 res = sess.run((a, b, c, a.name))
267 self.assertTrue(isinstance(res, tuple))
268 self.assertEqual((42.0, None, 44.0, 42.0), res)
269 tuple_runner = sess.make_callable((a, b, c, a.name))
270 res = tuple_runner()
271 self.assertTrue(isinstance(res, tuple))
272 self.assertEqual((42.0, None, 44.0, 42.0), res)
273
274 def testFetchNamedTuple(self):
275 # pylint: disable=invalid-name

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