aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/kernel_tests/control_flow_ops_py_test.py')
-rw-r--r--tensorflow/python/kernel_tests/control_flow_ops_py_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
index b70ec134ab..2a3acd6b76 100644
--- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
+++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
@@ -1325,5 +1325,16 @@ class TupleTest(tf.test.TestCase):
self.assertAllClose([[0.0, 1.0], [10.0, 11.0], [20.0, 21.0]],
v1.eval())
+ def testAcceptTensorsAsControlInputs(self):
+ with self.test_session():
+ var = tf.Variable(0)
+ assign = tf.assign(var, 1)
+ t, = tf.tuple([tf.constant(0)], control_inputs=[assign])
+
+ # Should trigger the assign.
+ t.eval()
+
+ self.assertEquals(1, var.eval())
+
if __name__ == "__main__":
tf.test.main()