tf.keras.ops.searchsorted

Perform a binary search, returning indices for insertion of values into sorted_sequence that maintain the sorting order.

sorted_sequence 1-D input tensor, sorted along the innermost dimension.
values N-D tensor of query insertion values.
side 'left' or 'right', specifying the direction in which to insert for the equality case (tie-breaker).

Tensor of insertion indices of same shape as values.