YouTip LogoYouTip

Pytorch Torch Isneginf

# PyTorch torch.isneginf Function * * * Image 3: PyTorch torch Reference Manual PyTorch torch Reference Manual `torch.isneginf` is a PyTorch function used to check for negative infinity. It returns a boolean tensor indicating whether each element is negative infinity. ### Function Definition torch.isneginf(input) * * * ## Examples ## Example import torch # Create a tensor with various values x = torch.tensor([1.0, float('inf'), float('-inf'), 2.0]) # Check if each element is negative infinity result = torch.isneginf(x) print(result) Output: tensor([False, False, True, False]) * * * Image 4: PyTorch torch Reference Manual PyTorch torch Reference Manual
← Pytorch Torch IsrealPytorch Torch Isinf β†’