aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework/ops_test.py
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2017-11-28 16:11:48 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-28 16:14:57 -0800
commita80fd2acf08ceba0c8fc7684c3013e8e7d6bd8d3 (patch)
tree4f828449eba3eb6b603266732bc79e5e40974508 /tensorflow/python/framework/ops_test.py
parent9049b440df17de47baf16d9e24590c3d0761e2c9 (diff)
C API: fix bug in ValidateNoCycles().
This change makes ValidateNoCycles() work when the graph has unused node ids (i.e. when Graph::num_nodes() < Graph::num_node_ids()). PiperOrigin-RevId: 177234002
Diffstat (limited to 'tensorflow/python/framework/ops_test.py')
-rw-r--r--tensorflow/python/framework/ops_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/python/framework/ops_test.py b/tensorflow/python/framework/ops_test.py
index 371eadcd13..3eae3b5a25 100644
--- a/tensorflow/python/framework/ops_test.py
+++ b/tensorflow/python/framework/ops_test.py
@@ -1876,6 +1876,14 @@ class GraphTest(test_util.TensorFlowTestCase):
gc.collect()
self.assertIsNone(g_ref())
+ def testRunnableAfterInvalidShape(self):
+ with ops.Graph().as_default():
+ with self.assertRaises(ValueError):
+ math_ops.add([1, 2], [1, 2, 3])
+ a = constant_op.constant(1)
+ with session.Session() as sess:
+ sess.run(a)
+
@test_util.with_c_api
class AttrScopeTest(test_util.TensorFlowTestCase):