PyTorch torch.bitwise_and-Funktion
PyTorch torch-Referenzhandbuch
torch.bitwise_andEs ist eine Funktion in PyTorch, die für elementweises bitweises UND verwendet wird.
Funktionsdefinition
torch.bitwise_and(input, other, *, out=None)
Anwendungsbeispiel
Beispiel
import torch
# Bitweises UND-Beispiel
x = torch.tensor([5, 3, 7], dtype=torch.int8)
y = torch.tensor([1, 3, 4], dtype=torch.int8)
result = torch.bitwise_and(x, y)
print(result) # tensor([1, 3, 4], dtype=int8)
# Bitweises UND-Beispiel
x = torch.tensor([5, 3, 7], dtype=torch.int8)
y = torch.tensor([1, 3, 4], dtype=torch.int8)
result = torch.bitwise_and(x, y)
print(result) # tensor([1, 3, 4], dtype=int8)
Andere Erweiterungen