PyTorch torch.bitwise_or Function
PyTorch torch Reference Manual
torch.bitwise_oris a function in PyTorch used for element-wise bitwise OR.
Function Definition
torch.bitwise_or(input, other, *, out=None)
Usage Example
Example
import torch
# Bitwise OR example
x = torch.tensor([5, 3, 7], dtype=torch.int8)
y = torch.tensor([1, 3, 4], dtype=torch.int8)
result = torch.bitwise_or(x, y)
print(result) # tensor([5, 3, 7], dtype=int8)
# Bitwise OR example
x = torch.tensor([5, 3, 7], dtype=torch.int8)
y = torch.tensor([1, 3, 4], dtype=torch.int8)
result = torch.bitwise_or(x, y)
print(result) # tensor([5, 3, 7], dtype=int8)
Other Extensions