快捷方式

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

文件

查閱 PyTorch 全面的開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

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

檢視資源