haojin2 commented on a change in pull request #15385: added doc for numpy 
operators
URL: https://github.com/apache/incubator-mxnet/pull/15385#discussion_r298425349
 
 

 ##########
 File path: python/mxnet/_numpy_op_doc.py
 ##########
 @@ -176,3 +176,229 @@ def _np_cumsum(a, axis=None, dtype=None, out=None):
         `axis` is not None or `a` is a 1-d array.
     """
     pass
+
+
+def _np_amax(a, axis=None, out=None):
+    r"""
+    amax(a, axis=None, out=None, keepdims=_Null, initial=_Null)
+
+    Return the maximum of an array or maximum along an axis.
+
+    Parameters
+    ----------
+    a : ndarray
+        Input data.
+        Python native iterables not supported.
+
+    axis : None or int or tuple of ints, optional
+        Axis or axes along which to operate. By default, flattened input is
+        used.
+
+        Negative indices not supported.
+
+    out : ndarray, optional
+        Alternative output array in which to place the result.  Must
+        be of the same shape and buffer length as the expected output.
+        See `doc.ufuncs` (Section "Output arguments") for more details.
+
+    keepdims : bool, optional
+        If this is set to True, the axes which are reduced are left
+        in the result as dimensions with size one. With this option,
+        the result will broadcast correctly against the input array.
+
+        If the default value is passed, then `keepdims` will not be
+        passed through to the `amax` method of sub-classes of
+        `ndarray`, however any non-default value will be.  If the
+        sub-class' method does not implement `keepdims` any
+        exceptions will be raised.
+
+    initial : scalar, optional
+        The minimum value of an output element. Must be present to allow
+        computation on empty slice.
+
+        Not supported yet.
+
+    Returns
+    -------
+    amax : ndarray or scalar
+        Maximum of `a`. If `axis` is None, the result is a scalar value.
+        If `axis` is given, the result is an array of dimension
+        ``a.ndim - 1``.
+
+    Examples
+    --------
+    >>> a = np.arange(4).reshape((2,2))
+    >>> a
+    array([[0, 1],
+           [2, 3]])
+    >>> np.amax(a)           # Maximum of the flattened array
+    array(3)
+    >>> np.amax(a, axis=0)   # Maxima along the first axis
+    array([2, 3])
+    >>> np.amax(a, axis=1)   # Maxima along the second axis
+    array([1, 3])
+    >>> np.amax(a, axis=1, keepdims=True)
+    array([[1],
+          [3]])
+
+    Notes
+    -----
+    This function differs to the original `numpy.amax
+    <https://docs.scipy.org/doc/numpy/reference/generated/numpy.amax.html>`_ in
+    the following aspects:
+
+    - The default value type is `float32` instead of `float64` in numpy.
+    - `a` only supports ndarray.
+    - `axis` doe snot support negative value.
+    - `initial` is not supported.
+    """
+    pass
+
+
+def _np_squeeze(a, axis=None):
+    r"""
+    Remove single-dimensional entries from the shape of an array.
+
+    Parameters
+    ----------
+    a : ndarray
+        Input data.
+
+    axis : None or int or tuple of ints, optional
+
+    Returns
+    -------
+    squeezed : ndarray
+        The input array, but with all or a subset of the
+        dimensions of length 1 removed. This is always `a` itself
+        or a view into `a`.
+
+    Examples
+    --------
+    >>> x = np.array([[[0], [1], [2]]])
+    >>> x.shape
+    (1, 3, 1)
+    >>> np.squeeze(x).shape
+    (3,)
+    >>> np.squeeze(x, axis=(2,)).shape
+    (1, 3)
+
+    Notes
+    -----
+    This function differs to the original `numpy.squeeze
+    
<https://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html>`_ in
+    the following aspects:
+
+    - The default value type is `float32` instead of `float64` in numpy.
+    - `a` only supports ndarray.
+    """
+    pass
+
+
+def _npi_ones(shape, dtype=None, order='C'):
+    r"""
+    ones(shape, dtype=None, order='C')
+    Return a new array of given shape and type, filled with ones.
+
+    Parameters
+    ----------
+    shape : int or sequence of ints
+        Shape of the new array, e.g., ``(2, 3)`` or ``2``.
+
+    dtype : data-type, optional
+        The desired data-type for the array, e.g., `int`. Default is `float32`.
+
+    order : {'C', 'F'}, optional, default: C
+        Whether to store multi-dimensional data in row-major
+        (C-style) or column-major (Fortran-style) order in
+        memory.
+
+        Not Supported yet.
+
+    Returns
+    -------
+    out : ndarray
+        Array of ones with the given shape, dtype, and order.
+
+    Examples
+    --------
+    >>> np.ones(5)
+    array([ 1.,  1.,  1.,  1.,  1.])
+    >>> np.ones((5,), dtype=int)
+    array([1, 1, 1, 1, 1])
+    >>> np.ones((2, 1))
+    array([[ 1.],
+           [ 1.]])
+    >>> s = (2,2)
+    >>> np.ones(s)
+    array([[ 1.,  1.],
+           [ 1.,  1.]])
+
+    Notes
+    -----
+    This function differs to the original `numpy.ones
+    <https://docs.scipy.org/doc/numpy/reference/generated/numpy.ones.html>`_ in
+    the following aspects:
+
+    - The default value type is `float32` instead of `float64` in numpy.
+    - `order` is not supported.
+    """
+
+
+def _npi_random_uniform(low=0.0, high=1.0, size=None):
 
 Review comment:
   This seems to be the same case as `_npi_ones`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to