dpnp.logical_not¶
- dpnp.logical_not = <DPNPUnaryFunc 'logical_not'>¶
Computes the logical NOT for each element \(x_i\) of input array x.
For full documentation refer to
numpy.logical_not.- Parameters:
- x{dpnp.ndarray, usm_ndarray}
Input array, may have any data type.
- out{None, dpnp.ndarray, usm_ndarray, tuple of ndarray}, optional
Output array to populate. Array must have the correct shape and the expected data type. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.
Default:
None.- order{None, "C", "F", "A", "K"}, optional
Memory layout of the newly output array, if parameter out is
None.Default:
"K".
- Returns:
- outdpnp.ndarray of bool dtype
An array containing the element-wise logical NOT results.
Limitations
Parameters where and subok are supported with their default values. Otherwise
NotImplementedErrorexception will be raised.See also
dpnp.logical_andCompute the truth value of x1 AND x2 element-wise.
dpnp.logical_orCompute the truth value of x1 OR x2 element-wise.
dpnp.logical_xorCompute the truth value of x1 XOR x2, element-wise.
Notes
At least one of x1 or x2 must be an array.
If
x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).Examples
>>> import dpnp as np >>> x = np.array([True, False, 0, 1]) >>> np.logical_not(x) array([False, True, True, False])
>>> x = np.arange(5) >>> np.logical_not(x < 3) array([False, False, False, True, True])