Implementing kernel
C++ engine symbols that back this Python API.Find insertion points to maintain order in a sorted sequence.
For each v = values[i] returns the smallest j such that
v < sorted_seq[j] (or <= when right=True). Equivalent
to per-element binary search.
Parameters
Returns
Tensorint64 tensor of insertion indices with the same shape as
values.
Notes
Sister function bucketize reverses the argument order
(values first).
Examples
>>> import lucid
>>> seq = lucid.tensor([1.0, 3.0, 5.0])
>>> lucid.searchsorted(seq, lucid.tensor([0.5, 2.0, 4.0, 6.0]))
Tensor([0, 1, 2, 3])