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])