Fonction torch.bitwise_not de PyTorch
Manuel de référence Pytorch torch
torch.bitwise_notC'est une fonction dans PyTorch utilisée pour le NON bit à bit élément par élément.
Définition de fonction
torch.bitwise_not(input, *, out=None)
Exemple d'utilisation
Exemple
import torch
# Exemple de NON bit à bit
x = torch.tensor([0, 1, 2, 3], dtype=torch.int8)
result = torch.bitwise_not(x)
print(result) # tensor([-1, -2, -3, -4], dtype=int8)
# Exemple de NON bit à bit
x = torch.tensor([0, 1, 2, 3], dtype=torch.int8)
result = torch.bitwise_not(x)
print(result) # tensor([-1, -2, -3, -4], dtype=int8)
Autres extensions