diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-07-11 13:24:29 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-07-11 14:32:52 -0700 |
commit | 979b575bd315d30486ae5f32fbcd93e6546b1b0b (patch) | |
tree | c765401c3ddfbcffe477cb03a92c88e0199b602b /tensorflow/python/kernel_tests/unpack_op_test.py | |
parent | 77c19a8bd77a69791ef4e8d81b43116da59a87ae (diff) |
Add support for Tensors of zero size to unpack.
Change: 127127852
Diffstat (limited to 'tensorflow/python/kernel_tests/unpack_op_test.py')
-rw-r--r-- | tensorflow/python/kernel_tests/unpack_op_test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/unpack_op_test.py b/tensorflow/python/kernel_tests/unpack_op_test.py index 0cb701db82..75a0cf3c37 100644 --- a/tensorflow/python/kernel_tests/unpack_op_test.py +++ b/tensorflow/python/kernel_tests/unpack_op_test.py @@ -131,5 +131,12 @@ class UnpackOpTest(tf.test.TestCase): with self.assertRaisesRegexp(ValueError, r'axis = -3 not in \[-2, 2\)'): tf.unpack(a, axis=-3) + def testZeroLengthDim(self): + with self.test_session(): + x = tf.zeros(shape=(0, 1, 2)) + y = tf.unpack(x, axis=1)[0].eval() + self.assertEqual(y.shape, (0, 2)) + + if __name__ == '__main__': tf.test.main() |