oneflow.bitwise_xor¶
-
oneflow.
bitwise_xor
()¶ Computes the bitwise XOR of input and other. The input tensor must be of integral or Boolean types. For bool tensors, it computes the logical XOR.
The interface is consistent with PyTorch. The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.bitwise_xor.html
- Parameters
input (oneflow.Tensor) – The input Tensor
other (oneflow.Tensor) – The Tensor to compute XOR with
- Returns
The output Tensor
- Return type
For example:
>>> import oneflow as flow >>> x = flow.tensor([1, 2, 3]) >>> flow.bitwise_xor(x, 2) tensor([3, 0, 1], dtype=oneflow.int64) >>> y = flow.tensor([5, 6, 7]) >>> flow.bitwise_xor(x, y) tensor([4, 4, 4], dtype=oneflow.int64)