maximum¶
-
maximum(x1, x2, out=None, **kwargs)¶ Returns element-wise maximum of the input arrays with broadcasting.
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.
Examples
>>> np.maximum(np.array([2, 3, 4]), np.array([1, 5, 2])) array([2., 5., 4.])
>>> np.maximum(np.eye(2), np.array([0.5, 2])) # broadcasting array([[1. , 2. ], [0.5, 2. ]])