aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/tests/tensor_array_ops_test.py
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2017-07-25 09:46:59 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-25 09:52:05 -0700
commit78cec04df0f714741f930ff3f234268102b71065 (patch)
tree5e571bde9ed59c97d7d52a07fe0f42e84bf8c3b6 /tensorflow/compiler/tests/tensor_array_ops_test.py
parent3169f504faae8ede8443525a073567a512095c4f (diff)
[TF:XLA] Make the shape of a TensorArray flow value a scalar.
Previously we used an f32[0] value, since the exact flow value does not matter, however this causes problems when a TensorArray computation is placed in a loop since the shape of the flow value is no longer loop invariant. PiperOrigin-RevId: 163082452
Diffstat (limited to 'tensorflow/compiler/tests/tensor_array_ops_test.py')
-rw-r--r--tensorflow/compiler/tests/tensor_array_ops_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/compiler/tests/tensor_array_ops_test.py b/tensorflow/compiler/tests/tensor_array_ops_test.py
index f277314352..ac039e0162 100644
--- a/tensorflow/compiler/tests/tensor_array_ops_test.py
+++ b/tensorflow/compiler/tests/tensor_array_ops_test.py
@@ -57,11 +57,13 @@ class TensorArrayTest(xla_test.XLATestCase):
r0 = w2.read(0)
r1 = w2.read(1)
r2 = w2.read(2)
+ flow = w2.flow
- d0, d1, d2 = session.run([r0, r1, r2])
+ d0, d1, d2, flow_val = session.run([r0, r1, r2, flow])
self.assertAllEqual([[4.0, 5.0]], d0)
self.assertAllEqual([[1.0, 3.0]], d1)
self.assertAllEqual([[7.0, -8.5]], d2)
+ self.assertAllEqual([], flow_val.shape)
def _testTensorArrayWritePack(self, tf_dtype):
with self.test_session(), self.test_scope():