torch.isneginf¶ torch.isneginf(input, *, out=None) → Tensor¶ 测试 input 中的每个元素是否为负无穷。 参数: input (Tensor) – 输入张量。 关键字参数: 输出(张量,可选)- 输出张量。 示例: >>> a = torch.tensor([-float('inf'), float('inf'), 1.2]) >>> torch.isneginf(a) tensor([ True, False, False])