Fonction torch.bitwise_or de PyTorch
Manuel de référence PyTorch torch
torch.bitwise_orest une fonction dans PyTorch utilisée pour le OU bit à bit élément par élément.
Définition de fonction
torch.bitwise_or(input, other, *, out=None)
Exemple d'utilisation
Exemple
import torch
# Exemple de OU bit à bit
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)
# Exemple de OU bit à bit
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)
Autres extensions