From 5823ce64bfec97cdfa0a781253795a6945d469f3 Mon Sep 17 00:00:00 2001 From: "Huang, Guangtai" Date: Fri, 6 Dec 2019 17:12:18 +0800 Subject: [PATCH] fix typo and doc (#16921) --- python/mxnet/symbol/numpy/_symbol.py | 60 ++++++++++++++-------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/python/mxnet/symbol/numpy/_symbol.py b/python/mxnet/symbol/numpy/_symbol.py index 8b64bbf86556..683bdb1cb200 100644 --- a/python/mxnet/symbol/numpy/_symbol.py +++ b/python/mxnet/symbol/numpy/_symbol.py @@ -1028,7 +1028,7 @@ def ones(shape, dtype=_np.float32, order='C', ctx=None): Returns ------- - out : ndarray + out : _Symbol Array of ones with the given shape, dtype, and ctx. """ if order != 'C': @@ -1270,7 +1270,7 @@ def divide(x1, x2, out=None, **kwargs): _npi.rtrue_divide_scalar, out) -@set_module('mxnet.ndarray.numpy') +@set_module('mxnet.symbol.numpy') def true_divide(x1, x2, out=None): return _ufunc_helper(x1, x2, _npi.true_divide, _np.divide, _npi.true_divide_scalar, _npi.rtrue_divide_scalar, out) @@ -1302,19 +1302,19 @@ def lcm(x1, x2, out=None, **kwargs): Parameters ---------- - x1, x2 : ndarrays or scalar values + x1, x2 : _Symbols or scalar values The arrays for computing lowest common multiple. If x1.shape != x2.shape, they must be broadcastable to a common shape (which may be the shape of one or the other). - out : ndarray or None, optional + out : _Symbol or None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. Returns ------- - y : ndarray or scalar + y : _Symbol or scalar The lowest common multiple of the absolute value of the inputs This is a scalar if both `x1` and `x2` are scalars. @@ -1447,7 +1447,7 @@ def eye(N, M=None, k=0, dtype=_np.float32, **kwargs): Returns ------- - I : ndarray of shape (N,M) + I : _Symbol of shape (N,M) An array where all elements are equal to zero, except for the k-th diagonal, whose values are equal to one. """ @@ -1778,7 +1778,7 @@ def cosh(x, out=None, **kwargs): ---------- x : _Symbol or scalar Input array or scalar. - out : ndarray or None + out : _Symbol or None Dummy parameter to keep the consistency with the ndarray counterpart. Returns @@ -2290,7 +2290,7 @@ def log2(x, out=None, **kwargs): ---------- x : _Symbol Input values. - out : ndarray or None + out : _Symbol or None A location into which the result is stored. If provided, it must have the same shape and type as the input. If not provided or None, a freshly-allocated array is returned. @@ -2876,7 +2876,7 @@ def arange(start, stop=None, step=1, dtype=None, ctx=None): Returns ------- - arange : ndarray + arange : _Symbol Array of evenly spaced values. For floating point arguments, the length of the result is @@ -2907,7 +2907,7 @@ def split(ary, indices_or_sections, axis=0): Parameters ---------- - ary : ndarray + ary : _Symbol Array to be divided into sub-arrays. indices_or_sections : int or 1-D python tuple, list or set. If `indices_or_sections` is an integer, N, the array will be divided @@ -2926,7 +2926,7 @@ def split(ary, indices_or_sections, axis=0): Returns ------- - sub-arrays : list of ndarrays + sub-arrays : _Symbol A list of sub-arrays. Raises @@ -2948,7 +2948,7 @@ def split(ary, indices_or_sections, axis=0): # pylint: disable=redefined-outer-name -@set_module('mxnet.ndarray.numpy') +@set_module('mxnet.symbol.numpy') def hsplit(ary, indices_or_sections): """Split an array into multiple sub-arrays horizontally (column-wise). @@ -3110,7 +3110,7 @@ def concatenate(seq, axis=0, out=None): Parameters ---------- - a1, a2, ... : sequence of array_like + a1, a2, ... : sequence of _Symbols The arrays must have the same shape, except in the dimension corresponding to `axis` (the first, by default). axis : int, optional @@ -3123,7 +3123,7 @@ def concatenate(seq, axis=0, out=None): Returns ------- - res : ndarray + res : _Symbol The concatenated array. Examples @@ -3152,9 +3152,9 @@ def append(arr, values, axis=None): # pylint: disable=redefined-outer-name Parameters ---------- - arr : ndarray + arr : _Symbol Values are appended to a copy of this array. - values : ndarray + values : _Symbol These values are appended to a copy of `arr`. It must be of the correct shape (the same shape as `arr`, excluding `axis`). If `axis` is not specified, `values` can be any shape and will be @@ -3165,7 +3165,7 @@ def append(arr, values, axis=None): # pylint: disable=redefined-outer-name Returns ------- - append : ndarray + append : _Symbol A copy of `arr` with `values` appended to `axis`. Note that `append` does not occur in-place: a new array is allocated and filled. If `axis` is None, `out` is a flattened array. @@ -3192,16 +3192,16 @@ def stack(arrays, axis=0, out=None): For example, if `axis=0` it will be the first dimension and if `axis=-1` it will be the last dimension. Parameters ---------- - arrays : sequence of array_like + arrays : sequence of _Symbols Each array must have the same shape. axis : int, optional The axis in the result array along which the input arrays are stacked. - out : ndarray, optional + out : _Symbol, optional If provided, the destination to place the result. The shape must be correct, matching that of what stack would have returned if no out argument were specified. Returns ------- - stacked : ndarray + stacked : _Symbol The stacked array has one more dimension than the input arrays.""" def get_list(arrays): if not hasattr(arrays, '__getitem__') and hasattr(arrays, '__iter__'): @@ -3744,7 +3744,7 @@ def ravel(x, order='C'): Parameters ---------- - x : ndarray + x : _Symbol Input array. The elements in `x` are read in row-major, C-style order and packed as a 1-D array. order : `C`, optional @@ -3752,7 +3752,7 @@ def ravel(x, order='C'): Returns ------- - y : ndarray + y : _Symbol y is an array of the same subtype as `x`, with shape ``(x.size,)``. Note that matrices are special cased for backward compatibility, if `x` is a matrix, then y is a 1-D ndarray. @@ -3778,7 +3778,7 @@ def unravel_index(indices, shape, order='C'): # pylint: disable=redefined-outer- Parameters: ------------- - indices : array_like + indices : _Symbol An integer array whose elements are indices into the flattened version of an array of dimensions shape. Before version 1.6.0, this function accepted just one index value. shape : tuple of ints @@ -3786,7 +3786,7 @@ def unravel_index(indices, shape, order='C'): # pylint: disable=redefined-outer- Returns: ------------- - unraveled_coords : ndarray + unraveled_coords : _Symbol Each row in the ndarray has the same shape as the indices array. Each column in the ndarray represents the unravelled index @@ -4434,16 +4434,16 @@ def outer(a, b): Parameters ---------- - a : (M,) ndarray + a : (M,) _Symbol First input vector. Input is flattened if not already 1-dimensional. - b : (N,) ndarray + b : (N,) _Symbol Second input vector. Input is flattened if not already 1-dimensional. Returns ------- - out : (M, N) ndarray + out : (M, N) _Symbol ``out[i, j] = a[i] * b[j]`` See also @@ -4924,18 +4924,18 @@ def diff(a, n=1, axis=-1, prepend=None, append=None): # pylint: disable=redefin Parameters ---------- - a : ndarray + a : _Symbol Input array n : int, optional The number of times values are differenced. If zero, the input is returned as-is. axis : int, optional The axis along which the difference is taken, default is the last axis. - prepend, append : ndarray, optional + prepend, append : _Symbol, optional Not supported yet Returns ------- - diff : ndarray + diff : _Symbol The n-th differences. The shape of the output is the same as a except along axis where the dimension is smaller by n. The type of the output is the same as the type of the difference between any two elements of a.