# tensorplay.functional.logical_xor Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.logical_xor.html ```python tensorplay.functional.logical_xor(input: Tensor, other: Tensor, *, out: Tensor | None) → Tensor ``` Computes the element-wise logical XOR of the given input tensors. Zeros are treated as False and nonzeros are treated as True. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. - other ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the tensor to compute XOR with Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> tensorplay.logical_xor(tensorplay.tensor([True, False, True]), tensorplay.tensor([True, False, False])) tensor([False, False, True]) >>> a = tensorplay.tensor([0, 1, 10, 0], dtype=tensorplay.int8) >>> b = tensorplay.tensor([4, 0, 1, 0], dtype=tensorplay.int8) >>> tensorplay.logical_xor(a, b) tensor([ True, True, False, False]) >>> tensorplay.logical_xor(a.double(), b.double()) tensor([ True, True, False, False]) >>> tensorplay.logical_xor(a.double(), b) tensor([ True, True, False, False]) >>> tensorplay.logical_xor(a, b, out=tensorplay.empty(4, dtype=tensorplay.bool)) tensor([ True, True, False, False]) ```