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

Method testFetchList

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

Source from the content-addressed store, hash-verified

244 self.assertEqual(None, res)
245
246 def testFetchList(self):
247 with session.Session() as sess:
248 a = constant_op.constant(42.0)
249 b = control_flow_ops.no_op() # An op, not a tensor.
250 c = constant_op.constant(44.0)
251 v = variables.Variable([54.0])
252 assign = v.assign([63.0])
253 res = sess.run([a, b, c, a.name, assign.op])
254 self.assertTrue(isinstance(res, list))
255 self.assertEqual([42.0, None, 44.0, 42.0, None], res)
256 list_runner = sess.make_callable([a, b, c, a.name, assign.op])
257 res = list_runner()
258 self.assertTrue(isinstance(res, list))
259 self.assertEqual([42.0, None, 44.0, 42.0, None], res)
260
261 def testFetchTuple(self):
262 with session.Session() as sess:

Callers

nothing calls this directly

Calls 6

assignMethod · 0.95
VariableMethod · 0.80
SessionMethod · 0.45
constantMethod · 0.45
runMethod · 0.45
make_callableMethod · 0.45

Tested by

no test coverage detected