fn
searchsorted_op
→TensorImplPtrint searchsorted_op(const int & sorted_1d, const int & values, bool right)Python wrappers
Public Python APIs implemented by this engine symbol.Per-query insertion point into a sorted 1-D (or row-wise N-D) reference.
Evaluates each query via binary search in time and
auxiliary memory per query, ordering NaN after +inf to match the
reference. Not differentiable — integer output.
Math
Let be the sorted reference and the query tensor. Then
with being when right = false (leftmost insertion) and
when right = true (rightmost insertion).
See Also
bucketize_op — same operation with the argument order flipped.
Parameters
sorted_ 1dTensorImplPtr1-D ascending-sorted reference of length , or an N-D tensor whose leading dimensions match
values.valuesTensorImplPtrQuery tensor of arbitrary shape
S.rightboolIf
true, returns the rightmost (post-equal) insertion point; otherwise the leftmost.Returns
TensorImplPtrint64 tensor of shape S whose entries lie in .
Raises
FailureIf either input is null or the shapes are incompatible.