The Numpy version of searchsorted takes an additional parameter to specify the semantic of the returned index:
| side |
returned index i satisfies |
| left |
a[i-1] < v <= a[i] |
| right |
a[i-1] <= v < a[i] |
The current implementation of searchsorted for Pytorch follows the left behavior, is it possible to implement the right version to allow ordering from the right?
The Numpy version of searchsorted takes an additional parameter to specify the semantic of the returned index:
The current implementation of
searchsortedfor Pytorch follows theleftbehavior, is it possible to implement therightversion to allow ordering from the right?