PyTorch torch.sin 関数


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

torch.sinPyTorch で要素ごとの正弦を計算するための関数です。

関数定義

torch.sin(input, out=None)

使用例

例

import torch

x = torch.tensor([0, torch.pi/2, torch.pi, 3*torch.pi/2])

print(torch.sin(x))

出力結果は次のとおりです:

tensor([ 0.0000e+00,  1.0000e+00, -8.7423e-08, -1.0000e+00])

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

その他の拡張