dpnp.maximum
- dpnp.maximum(x1, x2, /, out=None, *, where=True, order='K', dtype=None, subok=True, **kwargs)[source]
Element-wise maximum of array elements.
For full documentation refer to
numpy.maximum.- Returns:
out – The maximum of x1 and x2, element-wise, propagating NaNs.
- Return type:
dpnp.ndarray
Limitations
Parameters x1 and x2 are supported as either scalar,
dpnp.ndarrayordpctl.tensor.usm_ndarray, but both x1 and x2 can not be scalars at the same time. Parameters where, dtype and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.minimumElement-wise minimum of two arrays, propagates NaNs.
dpnp.fmaxElement-wise maximum of two arrays, ignores NaNs.
dpnp.maxThe maximum value of an array along a given axis, propagates NaNs.
dpnp.nanmaxThe maximum value of an array along a given axis, ignores NaNs.
dpnp.fminElement-wise minimum of two arrays, ignores NaNs.
dpnp.minThe minimum value of an array along a given axis, propagates NaNs.
dpnp.nanminThe minimum value of an array along a given axis, ignores NaNs.
Examples
>>> import dpnp as np >>> x1 = np.array([2, 3, 4]) >>> x2 = np.array([1, 5, 2]) >>> np.maximum(x1, x2) array([2, 5, 4])
>>> x1 = np.eye(2) >>> x2 = np.array([0.5, 2]) >>> np.maximum(x1, x2) # broadcasting array([[1. , 2. ], [0.5, 2. ]])
>>> x1 = np.array([np.nan, 0, np.nan]) >>> x2 = np.array([0, np.nan, np.nan]) >>> np.maximum(x1, x2) array([nan, nan, nan])
>>> np.maximum(np.array(np.Inf), 1) array(inf)