PyTorch torch.true_divide 関数
torch.true_dividePyTorch において、要素ごとに真の除算(浮動小数点除算)を実行するための関数です。
関数定義
torch.true_divide(input, other, out=None)
使用例
実例
import torch
# 要素ごとの真の除算
x = torch.tensor([5.0, 6.0, 7.0])
y = torch.tensor([2.0, 2.0, 2.0])
result = torch.true_divide(x, y)
print(result)
# 要素ごとの真の除算
x = torch.tensor([5.0, 6.0, 7.0])
y = torch.tensor([2.0, 2.0, 2.0])
result = torch.true_divide(x, y)
print(result)
その他の拡張
Pytorch torch リファレンスマニュアル