feat: add nextafter
to specification
#792
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
nextafter
#664 by addingnextafter
to the specification.x2
to an array for portable behavior. While NumPy and others support scalars (and this is a common use case), PyTorch only supports tensors forx2
. In general, we are consistent throughout the specification in requiring that positional array arguments be strictly arrays. Were we to make an exception here, I'd imagine that the exception would apply equally to other arithmetic operations (e.g.,add
,multiply
, etc) for which we have standardized functional APIs.x2
have the same data type asx1
for portable behavior. Libraries are free to support other data types and subsequently type promotion (e.g., NumPy), but this should not be guaranteed across conforming array libraries, as the general expectation is that one typically wants the next representable value in the same precision asx1
.x1
andx2
are equal and both zero, the result should bex2
.