Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Test passed; style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeygxy committed Jun 25, 2019
1 parent 3de1946 commit ff40c2e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
14 changes: 4 additions & 10 deletions python/mxnet/ndarray/numpy/_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

__all__ = ['zeros', 'ones', 'maximum', 'minimum', 'stack', 'arange', 'argmax',
'add', 'subtract', 'multiply', 'divide', 'mod', 'power', 'concatenate',
'clip', 'split', 'swapaxes', 'expand_dims', 'tile', 'linspace',
'sin', 'cos', 'sinh', 'cosh', 'log10', 'sqrt', 'vsplit']
'clip', 'split', 'vsplit', 'swapaxes', 'expand_dims', 'tile', 'linspace',
'sin', 'cos', 'sinh', 'cosh', 'log10', 'sqrt']


@set_module('mxnet.ndarray.numpy')
Expand Down Expand Up @@ -80,7 +80,7 @@ def ones(shape, dtype=None, **kwargs):
ctx : Context, optional
An optional device context (default is the current default context).
Returns:q
Returns
-------
out : ndarray
Array of zeros with the given shape, dtype, and ctx.
Expand Down Expand Up @@ -587,8 +587,7 @@ def split(ary, indices_or_sections, axis=0):
raise ValueError('array split does not result in an equal division')
section_size = int(axis_size / sections)
indices = [i * section_size for i in range(sections)]
elif isinstance(indices_or_sections, tuple) or isinstance(indices_or_sections, set) \
or isinstance(indices_or_sections, list):
elif isinstance(indices_or_sections, (list, set, tuple)):
indices = [0] + list(indices_or_sections)
else:
raise ValueError('indices_or_sections must either int or tuple of ints')
Expand Down Expand Up @@ -617,7 +616,6 @@ def vsplit(ary, indices_or_sections):
return split(ary, indices_or_sections, 0)



@set_module('mxnet.ndarray.numpy')
def tile(A, reps):
"""
Expand Down Expand Up @@ -903,7 +901,3 @@ def sqrt(x, out=None, **kwargs):
This function only supports input type of float.
"""
return _unary_func_helper(x, _npi.sqrt, _np.sqrt, out=out, **kwargs)




3 changes: 0 additions & 3 deletions python/mxnet/numpy/multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,3 @@ def sqrt(x, out=None, **kwargs):
This function only supports input type of float.
"""
return _mx_nd_np.sqrt(x, out=out, **kwargs)



5 changes: 2 additions & 3 deletions python/mxnet/symbol/numpy/_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,7 @@ def split(ary, indices_or_sections, axis=0):
sections = 0
if isinstance(indices_or_sections, int):
sections = indices_or_sections
elif isinstance(indices_or_sections, tuple) or isinstance(indices_or_sections, set) \
or isinstance(indices_or_sections, list):
elif isinstance(indices_or_sections, (list, set, tuple)):
indices = [0] + list(indices_or_sections)
else:
raise ValueError('indices_or_sections must either int or tuple of ints')
Expand Down Expand Up @@ -1540,7 +1539,7 @@ def log10(x, out=None, **kwargs):
-------
y : _Symbol or scalar
The logarithm to the base 10 of `x`, element-wise. NaNs are
turned where x is negative. This is a scalar if `x` is a scalar.
returned where x is negative. This is a scalar if `x` is a scalar.
Notes
----
Expand Down
1 change: 0 additions & 1 deletion tests/python/unittest/test_numpy_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ def get_indices(axis_size):
indices = tuple(indices)
return indices


shapes = [
(2, 1, 2, 9),
(4, 3, 3),
Expand Down

0 comments on commit ff40c2e

Please sign in to comment.