PyTorch torch.tanh 関数


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

torch.tanhPyTorch で要素ごとの双曲線正接を計算するための関数です。

関数定義

torch.tanh(input, out=None)

使用例

实例

import torch

# 双曲線正接を計算
x = torch.tensor([-1.0, 0.0, 1.0])
result = torch.tanh(x)
print(result)

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

その他の拡張