ckt624 commented on a change in pull request #15381: [Numpy] Add Documentations
URL: https://github.com/apache/incubator-mxnet/pull/15381#discussion_r298892675
##########
File path: python/mxnet/numpy/multiarray.py
##########
@@ -46,8 +46,120 @@
__all__ = ['ndarray', 'empty', 'array', 'zeros', 'ones', 'maximum', 'minimum',
'stack', 'arange',
'argmax', 'add', 'subtract', 'multiply', 'divide', 'mod', 'power',
'concatenate',
'clip', 'split', 'swapaxes', 'expand_dims', 'tile', 'linspace',
'sin', 'cos',
- 'sinh', 'cosh', 'log10', 'sqrt']
+ 'sinh', 'cosh', 'log10', 'sqrt', 'absolute', 'cbrt', 'arccos']
+@set_module('mxnet.numpy')
+def absolute(x, out=None, **kwargs):
+ """
+ Calculate the absolute value element-wise.
+ np.abs is a shorthand for this function.
+
+ Parameters
+ ----------
+ x : ndarray
+ Input array.
+
+ out : 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 length equal to
the number of outputs.
+
+ **kwargs
+ For other keyword-only arguments, see the ufunc docs.
+
+ Returns
+ ----------
+ absolute : ndarray
+ An ndarray containing the absolute value of each element in x.
+
+ Examples
+ ----------
+ >>> x = np.array([-1.2, 1.2])
+ >>> np.absolute(x)
+ array([ 1.2, 1.2])
+ """
+ return _mx_nd_np.absolute(x, out=out, **kwargs)
+
+@set_module('mxnet.numpy')
+def cbrt(x, out=None, **kwargs):
+ """
+ Return the cube-root of an array, element-wise.
+
+ Parameters
+ ----------
+ x : ndarray
+ The values whose cube-roots are required.
+
+ out : 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 length equal to
the number of outputs.
+
+ **kwargs
+ For other keyword-only arguments, see the ufunc docs.
+
+ Returns
+ ----------
+ y : ndarray
+ An array of the same shape as x, containing the cube cube-root of each
element in x.
+ If out was provided, y is a reference to it. This is a scalar if x is a
scalar.
+
+ Examples
+ ----------
+ >>> np.cbrt([1,8,27])
+ array([ 1., 2., 3.])
+ """
+ return _mx_nd_np.cbrt(x, out=out, **kwargs)
+
+@set_module('mxnet.numpy')
+def arccos(x, out=None, **kwargs):
+ """
+ Trigonometric inverse cosine, element-wise.
+ The inverse of cos so that, if y = cos(x), then x = arccos(y).
+
+ Parameters
+ ----------
+ x : ndarray
+ x-coordinate on the unit circle. For real arguments, the domain is [-1, 1].
+
+ out : 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 length equal to
the number of outputs.
+
+ **kwargs
+ For other keyword-only arguments, see the ufunc docs.
+
+ Returns
+ ----------
+ angle : ndarray
+ The angle of the ray intersecting the unit circle at the given
x-coordinate in radians [0, pi].
+ This is a scalar if x is a scalar.
+
+ See also
+ ----------
+ cos, arctan, arcsin
+
+ Notes
+ ----------
+
Review comment:
Thx. FIxed.
----------------------------------------------------------------
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