powered by
Nextafter
torch_nextafter(self, other)
(Tensor) the first input tensor
(Tensor) the second input tensor
Return the next floating-point value after input towards other, elementwise.
input
other
The shapes of input and other must be broadcastable .
if (torch_is_installed()) { eps <- torch_finfo(torch_float32())$eps torch_nextafter(torch_tensor(c(1, 2)), torch_tensor(c(2, 1))) == torch_tensor(c(eps + 1, 2 - eps)) }
Run the code above in your browser using DataLab