PyTorch torch.positive 関数


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

torch.positivePyTorch において要素ごとに正の値を取るための関数です。入力テンソルそのものを返します。

関数定義

torch.positive(input)

使用例

実例

import torch

# 要素ごとに正の値を取る
x = torch.tensor([1.0, 2.0, 3.0])
result = torch.positive(x)
print(result)

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

その他の拡張