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

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -882,3 +883,172 @@ 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)
+
+
+@set_module('mxnet.ndarray.numpy')
+def floor(x, out=None, **kwargs):
+    r"""
+    Return the floor of the input, element-wise.
+    The floor of the scalar `x` is the largest integer `i`, such that
+    `i <= x`.  It is often denoted as :math:`\lfloor x \rfloor`.
+
+    Parameters
+    ----------
+    x : ndarray
+        Input data.
+
+        Does not support scalar.
+
+    out : ndarray, None, or tuple of exactly one ndarray, 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. A tuple (possible only as a
+        keyword argument) must have exactly one element.
+
+    where : array_like, optional
+        Values of True indicate to calculate the ufunc at that position, values
+        of False indicate to leave the value in the output alone.
+
+        Not supported yet.
+
+    Returns
+    -------
+    y : ndarray
+        The floor of each element in `x`.
+
+    Notes
+    -----
+    Some spreadsheet programs calculate the "floor-towards-zero", in other
+    words ``floor(-2.5) == -2``.  MXNet instead uses the definition of
+    `floor` where `floor(-2.5) == -3`.
+
+    This function differs to the original `numpy.floor
+    <https://docs.scipy.org/doc/numpy/reference/generated/numpy.floor.html>`_ 
in
+    the following aspects:
+
+    - The default value type is `float32` instead of `float64` in numpy.
+    - `a` only supports ndarray.
+    - `a` doe snot support scalar.
 
 Review comment:
   "does not". and have you tried this operator with a scalar input? I believe 
the current `_unary_func_helper` was written to enable such support... 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to