diff options
Diffstat (limited to 'tensorflow/python/kernel_tests/argmax_op_test.py')
-rw-r--r-- | tensorflow/python/kernel_tests/argmax_op_test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/argmax_op_test.py b/tensorflow/python/kernel_tests/argmax_op_test.py index ce06769902..1202c463e8 100644 --- a/tensorflow/python/kernel_tests/argmax_op_test.py +++ b/tensorflow/python/kernel_tests/argmax_op_test.py @@ -20,6 +20,7 @@ from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes +from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops from tensorflow.python.platform import test @@ -115,6 +116,12 @@ class ArgMaxTest(test.TestCase): ans = op([1]).eval() self.assertAllEqual(ans, 0) + def testOutputEmpty(self): + with self.test_session(): + for op in math_ops.argmin, math_ops.argmax: + ret = op(array_ops.zeros(shape=[1, 0, 2]), axis=-1).eval() + self.assertEqual(ret.shape, (1, 0)) + if __name__ == "__main__": test.main() |