PyTorch torch.fmod 関数


Pytorch torch 参考手册Pytorch torch 参考マニュアル

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)

Pytorch torch 参考手册Pytorch torch 参考マニュアル

その他の拡張