Skip to content
fn

argsort_op

→TensorImplPtr
int argsort_op(const int & a, int axis)

Python wrappers

Public Python APIs implemented by this engine symbol.

Return the indices that would sort a along axis.

Parameters

aTensorImplPtr
Input tensor.
axisint
Axis along which to compute the sort permutation.

Returns

TensorImplPtr

Integer tensor of the same shape as a and dtype I64, such that a.take_along_axis(out, axis) equals sort_op(a, axis).

Notes

Non-differentiable (indices are discontinuous in the input values).