hzfan commented on a change in pull request #15388: Doc
URL: https://github.com/apache/incubator-mxnet/pull/15388#discussion_r298881285
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -720,6 +742,137 @@ 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.ndarray.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 : ndarray or scalar
+ Input data.
+ out : ndarray or None, optional
+ A location into which the result is stored.
+
+ Returns
+ -------
+ y : ndarray or scalar
+ The truncated value of each element in `x`.
+ This is a scalar if `x` is a scalar.
+
+ Notes
+ -----
+ This function differs to 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.
+
+ Examples
+ --------
+ >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
+ >>> np.trunc(a)
+ array([-1., -1., -0., 0., 1., 1., 2.])
+ """
+ return _unary_func_helper(x, _npi.trunc, _np.trunc, out=out, **kwargs)
+
+@set_module('mxnet.ndarray.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 : ndarray or scalar
+ Logical NOT is applied to the elements of `x`.
+ out : ndarray or None, optional
+ A location into which the result is stored.
+
+ Returns
+ -------
+ y : bool or ndarray of bool
+ Boolean result with the same shape as `x` of the NOT operation
+ on elements of `x`.
+ This is a scalar if `x` is a scalar.
+
+ Notes
+ -----
+ This function differs to the original numpy.logical_not 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.
+
+ Examples
+ --------
+ ***>>> x= np.array([True, False, 0, 1])
+ >>> np.logical_not(x)
+ array([0., 1., 1., 0.])
+
+ >>> x = np.arange(5)
+ >>> np.logical_not(x<3)
+ array([0., 0., 0., 1., 1.])
+ """
+ return _unary_func_helper(x, _npi.logical_not, _np.logical_not, out=out,
**kwargs)
+
+@set_module('mxnet.ndarray.numpy')
+def arccosh(x, out=None, **kwargs):
+ r"""
+ arccosh(x, out=None)
+
+ Inverse hyperbolic cosine, element-wise.
+
+ Parameters
+ ----------
+ x : ndarray or scalar
+ Input array.
+ out : ndarray or None, optional
+ A location into which the result is stored.
+
+ Returns
+ -------
+ arccosh : ndarray
+ Array of the same shape as `x`.
+ This is a scalar if `x` is a scalar.
+
+ Notes
+ -----
+ `arccosh` is a multivalued function: for each `x` there are infinitely
+ many numbers `z` such that `cosh(z) = x`. The convention is to return the
+ `z` whose imaginary part lies in `[-pi, pi]` and the real part in
+ ``[0, inf]``.
+
+ For real-valued input data types, `arccosh` always returns real output.
+ For each value that cannot be expressed as a real number or infinity, it
+ yields ``nan`` and sets the `invalid` floating point error flag.
+
+ For complex-valued input, `arccosh` is a complex analytical function that
+ has a branch cut `[-inf, 1]` and is continuous from above on it.
+
+ This function differs to the original numpy.logical_not 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.
Review comment:
\`x\`
----------------------------------------------------------------
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