torch.nextafter
function nextafter(input: Tensor, other: Tensor, options?: BinaryOptions): TensorReturns the next representable floating-point value after input towards other.
Parameters
inputTensor- Starting values
otherTensor- Direction values
optionsBinaryOptionsoptional- Optional settings including
outparameter
Returns
Tensor– Next representable float towards otherExamples
const x = torch.tensor([1.0, 2.0]);
const y = torch.tensor([2.0, 1.0]);
torch.nextafter(x, y); // next float towards y