torch.nextafter
-
torch.nextafter(input, other, *, out=None) → Tensor -
Возвращает следующее значение с плавающей запятой после
inputв направленииother, поэлементно.Формы
inputиotherдолжны быть совместимы для трансляции.- Параметры:
- Ключевые аргументы:
-
out (Тензор, необязательно) – выходной тензор.
Пример:
>>> eps = torch.finfo(torch.float32).eps >>> torch.nextafter(torch.tensor([1.0, 2.0]), torch.tensor([2.0, 1.0])) == torch.tensor([eps + 1, 2 - eps]) tensor([True, True])
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.nextafter.html