Implementing kernel
C++ engine symbols that back this Python API.Element-wise logical exclusive-OR.
Element-wise boolean operation. Non-boolean inputs are first reduced to their
truthiness (False iff the value is exactly zero) before the operation is
applied. The output dtype is bool.
Parameters
Returns
TensorBoolean tensor with shape broadcast(input.shape, other.shape).
Notes
Mathematical definition (with denoting boolean coercion):
Logical operations are not differentiable; gradients are dropped. Equivalent to input.bool() ^ other.bool().
Examples
>>> import lucid
>>> a = lucid.tensor([True, False, True])
>>> b = lucid.tensor([True, True, False])
>>> lucid.logical_xor(a, b)
Tensor([...])