dpnp.all
- dpnp.all(x, /, axis=None, out=None, keepdims=False, *, where=True)[source]
Test whether all array elements along a given axis evaluate to True.
For full documentation refer to
numpy.all
.- Returns:
out – An array with a data type of bool containing the results of the logical AND reduction.
- Return type:
dpnp.ndarray
Limitations
Parameters x is supported either as
dpnp.ndarray
ordpctl.tensor.usm_ndarray
. Parameters out and where are supported with default value. Input array data types are limited by supported DPNP Data types. Otherwise the function will be executed sequentially on CPU.See also
dpnp.ndarray.all
equivalent method
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) array(False)
>>> np.all(x, axis=0) array([ True, False])
>>> x2 = np.array([-1, 4, 5]) >>> np.all(x2) array(True)
>>> x3 = np.array([1.0, np.nan]) >>> np.all(x3) array(True)