PyTorch torch.remainder 関数
torch.remainderPyTorch で要素ごとの剰余演算を計算するための関数です。
関数定義
torch.remainder(input, other, out=None)
使用例
実例
import torch
# 要素ごとの剰余
x = torch.tensor([10.0, 20.0, 30.0])
y = torch.tensor([3.0, 4.0, 7.0])
result = torch.remainder(x, y)
print(result)
# 要素ごとの剰余
x = torch.tensor([10.0, 20.0, 30.0])
y = torch.tensor([3.0, 4.0, 7.0])
result = torch.remainder(x, y)
print(result)
その他の拡張
Pytorch torch リファレンスマニュアル