torch.isneginf¶ torch.isneginf(input, *, out=None) → Tensor¶ 測試 input 的每個元素是否為負無窮。 引數 input (Tensor) – 輸入的張量。 關鍵字引數 out (Tensor, 可選) – 輸出張量。 示例 >>> a = torch.tensor([-float('inf'), float('inf'), 1.2]) >>> torch.isneginf(a) tensor([ True, False, False])