torch.nextafter
-
torch.nextafter(input, other, *, out=None) → Tensor
-
Return the next floating-point value after
input
towardsother
, elementwise.The shapes of
input
andother
must be broadcastable.- Parameters
- Keyword Arguments
-
out (Tensor, optional) – the output tensor.
- Example::
-
>>> eps = torch.finfo(torch.float32).eps >>> torch.nextafter(torch.Tensor([1, 2]), torch.Tensor([2, 1])) == torch.Tensor([eps + 1, 2 - eps]) tensor([True, True])
© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.nextafter.html