PyTorch torch.divide-Funktion
PyTorch torch-Referenzhandbuch
torch.divideEs ist eine Funktion in PyTorch für elementweise Division (äquivalent zu div).
Funktionsdefinition
torch.divide(input, other, *, rounding_mode=None, out=None)
Anwendungsbeispiel
Beispiel
import torch
# Beispiel für elementweise Division
x = torch.tensor([10.0, 20.0, 30.0])
y = torch.tensor([2.0, 4.0, 5.0])
result = torch.divide(x, y)
print(result) # tensor([5.0000, 5.0000, 6.0000])
# Beispiel für elementweise Division
x = torch.tensor([10.0, 20.0, 30.0])
y = torch.tensor([2.0, 4.0, 5.0])
result = torch.divide(x, y)
print(result) # tensor([5.0000, 5.0000, 6.0000])
Andere Erweiterungen