You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/01 07:54:02 UTC

[GitHub] [incubator-mxnet] hgt312 commented on a change in pull request #15388: Doc

hgt312 commented on a change in pull request #15388: Doc
URL: https://github.com/apache/incubator-mxnet/pull/15388#discussion_r298919976
 
 

 ##########
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##########
 @@ -1407,8 +1419,111 @@ def _unary_func_helper(x, fn_array, fn_scalar, out=None, **kwargs):
     else:
         raise TypeError('type {} not supported'.format(str(type(x))))
 
+@set_module('mxnet.symbol.numpy')
+def trunc(x, out=None, **kwargs):
+    r"""
+    trunc(x, out=None)
+
+    Return the truncated value of the input, element-wise.
+
+    The truncated value of the scalar `x` is the nearest integer `i` which
+    is closer to zero than `x` is. In short, the fractional part of the
+    signed number `x` is discarded.
+    
+    Parameters
+    ----------
+    x : _Symbol or scalar
+        Input data.
+    out : _Symbol or None, optional
+        A location into which the result is stored. 
+    
+    Returns
+    -------
+    y : _Symbol or scalar
+        The truncated value of each element in `x`.
+        This is a scalar if `x` is a scalar.
+
+    Notes
+    -----
+    This function differs from the original numpy.trunc in the following aspects:
+        - Do not support `where`, a parameter in numpy which indicates where to calculate. 
+        - Cannot cast type automatically. Dtype of `out` must be same as the expected one.
+        - Cannot broadcast automatically. Shape of `out` must be same as the expected one.
+        - If `x` is plain python numeric, the result won't be stored in out.
+    """    
+    return _unary_func_helper(x, _npi.trunc, _np.trunc, out=out, **kwargs)
 
 @set_module('mxnet.symbol.numpy')
+def logical_not(x, out=None, **kwargs):
+    r"""
+    logical_not(x, out=None)
+
+    Compute the truth value of NOT x element-wise.
+
+    Parameters
+    ----------
+    x : _Symbol or scalar
+        Logical NOT is applied to the elements of `x`.
+    out : _Symbol or None, optional
 
 Review comment:
   `out` is a dummy parameter, the symbol will not be stored in it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services