快捷方式

torch.sin

torch.sin(input, *, out=None) Tensor

返回一個新張量,其中包含 input 中元素的正弦值。

outi=sin(inputi)\text{out}_{i} = \sin(\text{input}_{i})
引數

input (Tensor) – 輸入的張量。

關鍵字引數

out (Tensor, 可選) – 輸出張量。

示例

>>> a = torch.randn(4)
>>> a
tensor([-0.5461,  0.1347, -2.7266, -0.2746])
>>> torch.sin(a)
tensor([-0.5194,  0.1343, -0.4032, -0.2711])

文件

查閱 PyTorch 的完整開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源