PyTorch torch.arctan 関数
torch.arctanPyTorch で要素ごとのアークタンジェント(arctangent)を計算する関数であり、torch.atan機能は同じです。
関数定義
torch.arctan(input, out=None)
使用例
実例
import torch
# テンソルを作成
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# アークタンジェントを計算
result = torch.arctan(x)
print(result)
# テンソルを作成
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# アークタンジェントを計算
result = torch.arctan(x)
print(result)
出力結果は:
tensor([-0.7854, -0.4636, 0.0000, 0.4636, 0.7854])
その他の拡張
Pytorch torch リファレンスマニュアル