YouTip LogoYouTip

Pytorch Torch Logical_Xor

# PyTorch torch.logical_xor Function * * Pytorch torch Reference Manual](#) `torch.logical_xor` is a function in PyTorch used to compute the logical XOR operation on two tensors. ### Function Definition torch.logical_xor(input, other, out=None) * * * ## Usage Example ## Example import torch # Create two boolean tensors x = torch.tensor([True,False,True,False]) y = torch.tensor([True,True,False,False]) # Logical XOR operation z = torch.logical_xor(x, y) print("logical_xor:", z) Output result is: logical_xor: tensor([False, True, True, False]) * * Pytorch torch Reference Manual](#)
← Pytorch Torch LogspacePytorch Torch Logical_Not β†’