PyTorch torch.nextafter Function
PyTorch torch Reference Manual
torch.nextafteris a function in PyTorch used to return the next representable floating-point number element-wise.
Function Definition
torch.nextafter(input, other, out=None)
Usage Example
Example
import torch
# Returns the next representable floating-point number
x = torch.tensor([1.0, 2.0])
y = torch.tensor([2.0, 2.0])
result = torch.nextafter(x, y)
print(result)
# Returns the next representable floating-point number
x = torch.tensor([1.0, 2.0])
y = torch.tensor([2.0, 2.0])
result = torch.nextafter(x, y)
print(result)
Other Extensions