dpnp.any
- dpnp.any(x1, axis=None, out=None, keepdims=False)[source]
Test whether any array element along a given axis evaluates to True.
For full documentation refer to
numpy.any.Limitations
Input array is supported as
dpnp.ndarray. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types. Parameteraxisis supported only with default valueNone. Parameteroutis supported only with default valueNone. Parameterkeepdimsis supported only with default valueFalse.See also
dpnp.allTest whether all elements along a given axis evaluate to True.
Notes
Not a Number (NaN), positive infinity and negative infinity evaluate to True because these are not equal to zero.
Examples
>>> import dpnp as np >>> x = np.array([[True, False], [True, True]]) >>> np.any(x) True >>> x2 = np.array([0, 0, 0]) >>> np.any(x2) False >>> x3 = np.array([1.0, np.nan]) >>> np.any(x3) True