aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/unpack_op_test.py
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2015-12-15 14:46:48 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2015-12-15 14:46:48 -0800
commit1b0b52430b4038a90c185bb02b687e76133d259c (patch)
tree487ac71c61737e05d64261597cc0a3f5649a2cf5 /tensorflow/python/kernel_tests/unpack_op_test.py
parentc435b0aa60f67af8b7cce67e1be414f823759393 (diff)
Add a human-readable Tensor.__repr__(), and improve TensorShape.__str__().
The repr replaces the default Python representation for an object with information about the Tensor's name, shape and dtype. TensorShape's new str() is a more compact representation that makes it easier to tell, at a glance, what the shape represents. For example: print repr(tf.placeholder(tf.qint32, shape=(32, None, 2), name="c")) # ==> <tf.Tensor 'c:0' shape=(32, ?, 2) dtype=qint32> Fixes #460. Change: 110268564
Diffstat (limited to 'tensorflow/python/kernel_tests/unpack_op_test.py')
-rw-r--r--tensorflow/python/kernel_tests/unpack_op_test.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/python/kernel_tests/unpack_op_test.py b/tensorflow/python/kernel_tests/unpack_op_test.py
index 47ed9e617c..621c717617 100644
--- a/tensorflow/python/kernel_tests/unpack_op_test.py
+++ b/tensorflow/python/kernel_tests/unpack_op_test.py
@@ -65,7 +65,7 @@ class UnpackOpTest(tf.test.TestCase):
def testCannotInferNum(self):
x = tf.placeholder(np.float32)
with self.assertRaisesRegexp(
- ValueError, r'Cannot infer num from shape TensorShape\(None\)'):
+ ValueError, r'Cannot infer num from shape <unknown>'):
tf.unpack(x)