diff --git a/python/mxnet/ndarray/numpy/_op.py b/python/mxnet/ndarray/numpy/_op.py index 99e55fe01b6c..98a5373c1579 100644 --- a/python/mxnet/ndarray/numpy/_op.py +++ b/python/mxnet/ndarray/numpy/_op.py @@ -6687,9 +6687,7 @@ def median(a, axis=None, out=None, overwrite_input=None, keepdims=False): >>> np.median(a, axis=1) array([7., 2.]) """ - from mxnet import np, npx - npx.set_np() - return quantile(a=a, q=np.array(0.5), axis=axis, out=out, overwrite_input=overwrite_input, + return quantile(a=a, q=0.5, axis=axis, out=out, overwrite_input=overwrite_input, interpolation='midpoint', keepdims=keepdims) diff --git a/python/mxnet/numpy/multiarray.py b/python/mxnet/numpy/multiarray.py index 65bdeb05e53d..e11925842704 100644 --- a/python/mxnet/numpy/multiarray.py +++ b/python/mxnet/numpy/multiarray.py @@ -8708,7 +8708,7 @@ def median(a, axis=None, out=None, overwrite_input=None, keepdims=False): array([7., 2.]) """ return _mx_nd_np.median(a, axis=axis, overwrite_input=overwrite_input, - keepdims=keepdims, out=out) + keepdims=keepdims, out=out) @set_module('mxnet.numpy') diff --git a/tests/python/unittest/test_numpy_op.py b/tests/python/unittest/test_numpy_op.py index 3b069b1dfeb3..568fe460acf4 100644 --- a/tests/python/unittest/test_numpy_op.py +++ b/tests/python/unittest/test_numpy_op.py @@ -7284,7 +7284,6 @@ def hybrid_forward(self, F, a): assert_almost_equal(mx_out.asnumpy(), np_out, atol=atol, rtol=rtol) - @with_seed() @use_np def test_np_quantile():