Skip to content
fn

bitwise_xor_op

→TensorImplPtr
int bitwise_xor_op(const int & a, const int & b)

Python wrappers

Public Python APIs implemented by this engine symbol.

Element-wise bitwise XOR.

Computes out[i] = a[i] ^ b[i] for every element. Defined on integer and Bool dtypes; on Bool inputs this is equivalent to logical exclusive-or.

Non-differentiable: no autograd node is registered.

Math

out[i]=a[i] ⊕bit b[i]. \mathrm{out}[i] = a[i] \,\oplus_{\text{bit}}\, b[i].

References

NumPy numpy.bitwise_xor.

See Also

bitwise_and_op, bitwise_or_op

Parameters

a, bTensorImplPtr
Operands of identical shape, integer-or-Bool dtype, and device.

Returns

TensorImplPtr

Tensor of the same shape and dtype as the inputs.

Raises

LucidError
If shapes/devices differ, or if the input dtype is not integer or Bool.