PyTorch torch.remainder 関数


Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

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)

Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

その他の拡張