ivy.argsort(x: Union[ivy.Array, ivy.NativeArray], axis: int = - 1, f: Optional[ivy.Framework] = None) → Union[ivy.Array, ivy.NativeArray][source]

Returns the indices of a tensor that give its sorted order along an axis.

  • x (array) – Input array containing elements to argsort.

  • axis (int, optional) – Axis to perform the argsort, default is -1.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


The indices that would sort each slice of the given values along the given axis.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty