cupy.searchsorted — CuPy 13.4.1 documentation (original) (raw)

cupy.searchsorted(a, v, side='left', sorter=None)[source]#

Finds indices where elements should be inserted to maintain order.

Find the indices into a sorted array a such that, if the corresponding elements in v were inserted before the indices, the order of a would be preserved.

Parameters:

Returns:

Array of insertion points with the same shape as v.

Return type:

cupy.ndarray

Note

When a is not in ascending order, behavior is undefined.