dpnp.all

dpnp.all(x1, axis=None, out=None, keepdims=False)[source]

Test whether all array elements along a given axis evaluate to True.

For full documentation refer to numpy.all.

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. Parameter axis is supported only with default value None. Parameter out is supported only with default value None. Parameter keepdims is supported only with default value False.

See also

dpnp.any

Test whether any element along a given axis evaluates 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.all(x)
False
>>> x2 = np.array([-1, 4, 5])
>>> np.all(x2)
True
>>> x3 = np.array([1.0, np.nan])
>>> np.all(x3)
True