diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-04-25 19:43:14 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-25 19:45:56 -0700 |
commit | e31dc1c13994d85a95689f0f61092489ebaa83cf (patch) | |
tree | bec1eb87e155715edcab42f7d49e1eb9bb0ac66e /tensorflow/python/kernel_tests/control_flow_ops_py_test.py | |
parent | 5a751a41aa92068ca0dbf991524cb4bed90c630f (diff) |
Improve shape invariant error message for tf.while_loop.
PiperOrigin-RevId: 194336902
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.py | 9 |
1 files changed, 4 insertions, 5 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 e27eb00818..209411cf51 100644 --- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py +++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py @@ -1135,11 +1135,10 @@ class ControlFlowTest(test.TestCase): with self.assertRaisesRegexp( ValueError, - r"The shape for while_1/Merge_1:0 is not an invariant for the loop. " - r"It enters the loop with shape \(2, 2\), but has shape \(4, 2\) " - r"after one iteration. Provide shape invariants using either the " - r"`shape_invariants` argument of tf.while_loop or set_shape\(\) on " - r"the loop variables."): + r"Input tensor 'ones:0' enters the loop with shape \(2, 2\), but has " + r"shape \(4, 2\) after one iteration. To allow the shape to vary " + r"across iterations, use the `shape_invariants` argument of " + r"tf.while_loop to specify a less-specific shape."): r = control_flow_ops.while_loop(c, b, [i, m]) def testWhileShapeInferenceSparseTensor(self): |