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

Method testErrorBasedOn

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

Source from the content-addressed store, hash-verified

193 s.partial_run('foo', r1, feed_dict={a: 1, b: 2})
194
195 def testErrorBasedOn(self):
196 with session.Session() as sess:
197 a = constant_op.constant(0.0, shape=[2, 3])
198 # NOTE(mrry): The original_op is nonsense, but used here to test that the
199 # errors are reported correctly.
200 with sess.graph._original_op(a.op):
201 b = array_ops.identity(a, name='id')
202 with sess.graph._original_op(b.op):
203 c = array_ops.placeholder(dtypes.float32)
204
205 def exc_predicate(e):
206 return (e.op == c.op and e.op._original_op == b.op and
207 e.op._original_op._original_op == a.op)
208
209 with self.assertRaisesOpError(exc_predicate):
210 c.eval()
211
212 def testFetchNone(self):
213 with session.Session() as s:

Callers

nothing calls this directly

Calls 7

_original_opMethod · 0.80
assertRaisesOpErrorMethod · 0.80
SessionMethod · 0.45
constantMethod · 0.45
identityMethod · 0.45
placeholderMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected