dpnp.logical_not

dpnp.logical_not(x, out=None, where=True, order='K', dtype=None, subok=True, **kwargs)

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.

  • out ({None, dpnp.ndarray, usm_ndarray}, optional) -- Output array to populate. Array must have the correct shape and the expected data type. Default: None.

  • order ({"C", "F", "A", "K"}, optional) -- Memory layout of the newly output array, if parameter out is None. Default: "K".

Returns:

out -- An array containing the element-wise logical NOT results.

Return type:

dpnp.ndarray

Limitations

Parameters where and subok are supported with their default values. Otherwise NotImplementedError exception will be raised.

See also

dpnp.logical_and

Compute the truth value of x1 AND x2 element-wise.

dpnp.logical_or

Compute the truth value of x1 OR x2 element-wise.

dpnp.logical_xor

Compute the truth value of x1 XOR x2, element-wise.

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])