PyTorch torch.acos 関数
torch.acosPyTorch で要素ごとに逆余弦(アークコサイン)を計算するために使用される関数です。
関数定義
torch.acos(input, out=None)
使用例
例
import torch
# テンソルを作成
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# 逆余弦を計算
result = torch.acos(x)
print(result)
# テンソルを作成
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# 逆余弦を計算
result = torch.acos(x)
print(result)
出力結果は次のとおりです。
tensor([3.1416, 2.0944, 1.5708, 1.0472, 0.0000])
その他の拡張
Pytorch torch リファレンスマニュアル