PyTorch torch.fmod 関数
torch.fmodPyTorch で要素ごとの剰余を計算するための関数です。
関数定義
torch.fmod(input, other, out)
使用例
例
import torch
# 要素ごとの剰余を計算
x = torch.tensor([10, 15, 20])
y = torch.tensor([3, 4, 7])
result = torch.fmod(x, y)
print(result)
# 要素ごとの剰余を計算
x = torch.tensor([10, 15, 20])
y = torch.tensor([3, 4, 7])
result = torch.fmod(x, y)
print(result)
その他の拡張
Pytorch torch 参考マニュアル