tingying2020 commented on a change in pull request #15387: Add docs for 7 ops
URL: https://github.com/apache/incubator-mxnet/pull/15387#discussion_r298916493
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -382,26 +381,41 @@ def multiply(x1, x2, out=None):
@set_module('mxnet.ndarray.numpy')
def divide(x1, x2, out=None):
- """Returns a true division of the inputs, element-wise.
- Parameters
- ----------
- x1 : ndarray or scalar
- Dividend array.
+ """
+ Returns a true division of the inputs, element-wise.
+ Instead of the Python traditional ‘floor division’,
+ this returns a true division. True division adjusts
+ the output type to present the best answer, regardless
+ of input types.
- x2 : ndarray or scalar
- Divisor array.
+ Parameters:
+ ----------
+ x1 : array_like
+ Dividend array.
+ x2 : array_like
+ Divisor array.
+ out : ndarray, None, or tuple of ndarray and None, 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.
+ 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.
+
+ Returns:
+ --------
+ y : ndarray
+ Result is scalar if both inputs are scalar, ndarray otherwise.
- out : ndarray
- 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.
+ Examples:
- Returns
- -------
- out : ndarray or scalar
- This is a scalar if both x1 and x2 are scalars.
+ >>> x = np.arange(5)
+ >>> np.true_divide(x, 4)
Review comment:
AttributeError: module 'mxnet.numpy' has no attribute 'true_divide'. You'd
better double check 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:
[email protected]
With regards,
Apache Git Services