From 5a99737ddcd5dad81bb05e0185e0cce40a3102d5 Mon Sep 17 00:00:00 2001 From: Wang Jiajun Date: Fri, 19 Apr 2019 18:38:44 +0000 Subject: [PATCH] add test --- tests/python/unittest/test_operator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/python/unittest/test_operator.py b/tests/python/unittest/test_operator.py index f2d8a1b2524f..78c8760bfb73 100644 --- a/tests/python/unittest/test_operator.py +++ b/tests/python/unittest/test_operator.py @@ -6990,6 +6990,20 @@ def test_float16_min_max(): assert np.finfo('float16').max == mx.nd.max(a).asscalar() +@with_seed() +def test_zero_sized_min_max(): + def min(): + a = mx.nd.zeros(shape=(5, 0)) + a.min() + + def max(): + a = mx.nd.zeros(shape=(5, 0)) + a.max() + + assert_raises(MXNetError, min) + assert_raises(MXNetError, max) + + @with_seed() def test_squeeze_op(): def check_squeeze_op(shape, axis=None):