ClikaRT::ops::searchsorted
function
searchsorted()
Tensor searchsorted(
Tensor sorted_sequence,
Tensor values,
bool out_int32 = false,
bool right = false,
std::optional<bool> side = std::nullopt,
OptionalTensor sorter = {}
)
Insertion points of values into a sorted sequence.
For each value, the index in sorted_sequence's last axis where it would insert to keep the order: right == false gives the leftmost admissible slot, true the rightmost. side, when present, must AGREE with right (it is the same switch under its string-API name); sorter supplies indices that sort an unsorted sequence.
Parameters
sorted_sequence: the sorted haystack (last-axis sorted).values: the needles; output mirrors this shape.out_int32: emitInt32indices instead ofInt64.right: insertion side for ties; default false (left).side: optional string-API twin ofright; a present value that contradictsrightis an error.sorter: optionalInt64/Int32indices sorting the sequence.
Returns: integer insertion indices, shaped like values.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whensidecontradictsrightor the operand shapes are incompatible.
Declared in ClikaRT/compute/ops.h, line 4618