latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.logical_not
- tensorplay.functional.logical_not(input, *, out=None) Tensor[source]
Computes the element-wise logical NOT of the given input tensor. If not specified, the output tensor will have the bool dtype. If the input tensor is not a bool tensor, zeros are treated as
Falseand non-zeros are treated asTrue.- Parameters:
input (Tensor) – the input tensor.
- Keyword Arguments:
out (Tensor, optional) – the output tensor.
Example:
>>> tensorplay.logical_not(tensorplay.tensor([True, False])) tensor([False, True]) >>> tensorplay.logical_not(tensorplay.tensor([0, 1, -10], dtype=tensorplay.int8)) tensor([ True, False, False]) >>> tensorplay.logical_not(tensorplay.tensor([0., 1.5, -10.], dtype=tensorplay.double)) tensor([ True, False, False]) >>> tensorplay.logical_not(tensorplay.tensor([0., 1., -10.], dtype=tensorplay.double), out=tensorplay.empty(3, dtype=tensorplay.int16)) tensor([1, 0, 0], dtype=tensorplay.int16)
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

