haojin2 commented on a change in pull request #17567: [Numpy] Add op fmax,
fmin, fmod
URL: https://github.com/apache/incubator-mxnet/pull/17567#discussion_r391943379
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -4367,6 +4396,26 @@ def maximum(x1, x2, out=None, **kwargs):
return _ufunc_helper(x1, x2, _npi.maximum, _np.maximum,
_npi.maximum_scalar, None, out)
+@set_module('mxnet.ndarray.numpy')
+@wrap_np_binary_func
+def fmax(x1, x2, out=None, **kwargs):
+ """
+ Returns element-wise maximum of the input arrays with broadcasting.
(Ignores NaNs)
+
+ Parameters
+ ----------
+ x1, x2 : scalar or mxnet.numpy.ndarray
+ The arrays holding the elements to be compared. They must have the
same shape,
+ or shapes that can be broadcast to a single shape.
+
+ Returns
+ -------
+ out : mxnet.numpy.ndarray or scalar
+ The maximum of x1 and x2, element-wise. This is a scalar if both x1
and x2 are scalars."""
+ if isinstance(x1, numeric_types) and isinstance(x2, numeric_types):
+ _np.fmax(x1, x2, out=out)
+ return _api_internal.fmax(x1, x2, out)
+
Review comment:
one more blank line below.
----------------------------------------------------------------
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