diff --git a/python/mxnet/ndarray/numpy/_op.py b/python/mxnet/ndarray/numpy/_op.py index ac63f441594c..112cee6d10ca 100644 --- a/python/mxnet/ndarray/numpy/_op.py +++ b/python/mxnet/ndarray/numpy/_op.py @@ -634,7 +634,7 @@ def tile(A, reps): """ return _unary_func_helper(A, _npi.tile, _np.tile, reps=reps) - +# pylint: disable=redefined-outer-name @set_module('mxnet.ndarray.numpy') def split(ary, indices_or_sections, axis=0): """Split an array into multiple sub-arrays. @@ -682,6 +682,7 @@ def split(ary, indices_or_sections, axis=0): if not isinstance(ret, list): return [ret] return ret +# pylint: enable=redefined-outer-name @set_module('mxnet.ndarray.numpy') diff --git a/python/mxnet/numpy/multiarray.py b/python/mxnet/numpy/multiarray.py index 6d191854d9d4..4cb0d0b7a949 100644 --- a/python/mxnet/numpy/multiarray.py +++ b/python/mxnet/numpy/multiarray.py @@ -1879,7 +1879,6 @@ def concatenate(seq, axis=0, out=None): return _mx_nd_np.concatenate(seq, axis=axis, out=out) -# pylint: disable=redefined-outer-name @set_module('mxnet.numpy') def indices(dimensions, dtype=_np.int32, ctx=None): """Return an array representing the indices of a grid. @@ -1939,4 +1938,3 @@ def indices(dimensions, dtype=_np.int32, ctx=None): extract the required elements directly with ``x[:2, :3]``. """ return _mx_nd_np.indices(dimensions=dimensions, dtype=dtype, ctx=ctx) -# pylint: enable=redefined-outer-name diff --git a/python/mxnet/symbol/numpy/_symbol.py b/python/mxnet/symbol/numpy/_symbol.py index 138cba37e8f7..06e3cefd7315 100644 --- a/python/mxnet/symbol/numpy/_symbol.py +++ b/python/mxnet/symbol/numpy/_symbol.py @@ -1270,6 +1270,7 @@ def arange(start, stop=None, step=1, dtype=None, ctx=None): return _npi.arange(start=start, stop=stop, step=step, dtype=dtype, ctx=ctx) +# pylint: disable=redefined-outer-name @set_module('mxnet.symbol.numpy') def split(ary, indices_or_sections, axis=0): """Split an array into multiple sub-arrays. @@ -1310,6 +1311,7 @@ def split(ary, indices_or_sections, axis=0): raise ValueError('indices_or_sections must either int or tuple of ints') ret = _npi.split(ary, indices, axis, False, sections) return ret +# pylint: enable=redefined-outer-name @set_module('mxnet.symbol.numpy') diff --git a/tests/python/unittest/test_numpy_op.py b/tests/python/unittest/test_numpy_op.py index 616dfac2f38e..2dce5d71a157 100644 --- a/tests/python/unittest/test_numpy_op.py +++ b/tests/python/unittest/test_numpy_op.py @@ -886,14 +886,12 @@ def get_new_shape(shape, axis): def test_np_indices(): dtypes = ['int32', 'int64', 'float16', 'float32', 'float64'] shapes = [ - (), (0,), (1,), (2,3,4), (2,0,4), (1,1,1,1), (1,0,0,1), - (4,), (2,3,4,5,6,7,8) ] if platform.system() == 'Windows':