Pytorch Torch Isneginf
# PyTorch torch.isneginf Function
* * *
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])
* * *
PyTorch torch Reference Manual
YouTip