PyTorch torch.cosh 関数
torch.coshPyTorch で要素ごとに双曲余弦を計算する関数です。
関数定義
torch.cosh(input, *, out=None)
使用例
実例
import torch
# 双曲余弦の例
x = torch.tensor([0, 1, 2, 3], dtype=torch.float32)
result = torch.cosh(x)
print(result) # tensor([1.0000, 1.5431, 3.7622, 10.0677])
# 双曲余弦の例
x = torch.tensor([0, 1, 2, 3], dtype=torch.float32)
result = torch.cosh(x)
print(result) # tensor([1.0000, 1.5431, 3.7622, 10.0677])
その他の拡張
Pytorch torch リファレンスマニュアル