oneflow.logical_xor

oneflow.logical_xor()

Computes the element-wise logical XOR of the given input tensors. Zeros are treated as False and nonzeros are treated as True.

Parameters
Returns

The output Tensor

Return type

oneflow.Tensor

For example:

>>> import numpy as np
>>> import oneflow as flow

>>> input1 = flow.tensor(np.array([1, 0, 1]).astype(np.float32), dtype=flow.float32)
>>> input2 = flow.tensor(np.array([1, 0, 0]).astype(np.float32), dtype=flow.float32)
>>> out = flow.logical_xor(input1, input2)
>>> out
tensor([False, False,  True], dtype=oneflow.bool)