oneflow.logical_not

oneflow.logical_not()

Computes the element-wise logical NOT of the given input tensors. Zeros are treated as False and nonzeros are treated as True. :param input: The input Tensor :type input: oneflow.Tensor :param other: The Tensor to compute NOT with :type other: oneflow.Tensor

Returns

The output Tensor

Return type

oneflow.Tensor

For example:

>>> import oneflow as flow

>>> input = flow.tensor([1, 0, -1], dtype=flow.float32)
>>> out = flow.logical_not(input)
>>> out
tensor([False,  True, False], dtype=oneflow.bool)