PyTorch torch.frac 関数


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

torch.fracは PyTorch で要素ごとの小数部分を計算するための関数です。

関数定義

torch.frac(input, out)

使用例

例

import torch

# 小数部分を計算
x = torch.tensor([1.5, 2.7, 3.1, 4.9])
result = torch.frac(x)
print(result)

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

その他の拡張