fn
logical_not
→Tensorlogical_not(input: Tensor)Element-wise logical NOT.
Returns a boolean tensor that is True where input is falsy (numerically
zero or boolean False) and False otherwise.
Parameters
inputTensorInput tensor; values are interpreted as booleans (zero →
False,
non-zero → True).Returns
TensorBoolean tensor with the same shape as input.
Notes
Mathematical definition:
Not differentiable; gradients are dropped.
Examples
>>> import lucid
>>> x = lucid.tensor([True, False, True])
>>> lucid.logical_not(x)
Tensor([False, True, False])