快捷方式

torch.positive

torch.positive(input) Tensor

返回 input。如果 input 是布林張量,則丟擲執行時錯誤。

引數

input (Tensor) – 輸入張量。

示例

>>> t = torch.randn(5)
>>> t
tensor([ 0.0090, -0.2262, -0.0682, -0.2866,  0.3940])
>>> torch.positive(t)
tensor([ 0.0090, -0.2262, -0.0682, -0.2866,  0.3940])

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源