mindspore.ops.logical_not
- mindspore.ops.logical_not(x)[source]
Computes the “logical NOT” of a tensor element-wise.
- Parameters
x (Tensor) – The input tensor whose dtype is bool.
where means,any number of additional dimensions.- Returns
Tensor, the shape is the same as the x, and the dtype is bool.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> x = Tensor(np.array([True, False, True]), mindspore.bool_) >>> output = ops.logical_not(x) >>> print(output) [False True False]