快捷鍵

torch.tan

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

返回一個新的張量,其元素為 input 的正切值。

outi=tan(inputi)\text{out}_{i} = \tan(\text{input}_{i})
參數

input (Tensor) – 輸入張量。

關鍵字參數

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

範例

>>> a = torch.randn(4)
>>> a
tensor([-1.2027, -1.7687,  0.4412, -1.3856])
>>> torch.tan(a)
tensor([-2.5930,  4.9859,  0.4722, -5.3366])

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

取得針對初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源