dpnp.tensor.argsort

dpnp.tensor.argsort(x, axis=-1, descending=False, stable=True, kind=None)[source]

Returns the indices that sort an array x along a specified axis.

Parameters:
  • x (usm_ndarray) -- Input array.

  • axis (int, optional) --

    Axis along which to sort. If set to -1, the function must sort along the last axis.

    Default: -1.

  • descending (bool, optional) --

    Sort order. If True, the array must be sorted in descending order (by value). If False, the array must be sorted in ascending order (by value).

    Default: False.

  • stable (bool, optional) --

    Sort stability. If True, the returned array must maintain the relative order of x values which compare as equal. If False, the returned array may or may not maintain the relative order of x values which compare as equal.

    Default: True.

  • kind ({None, "stable", "mergesort", "radixsort"}, optional) --

    Sorting algorithm. The default is "stable", which uses parallel merge-sort or parallel radix-sort algorithms depending on the array data type.

    Default: None.

Returns:

out -- An array of indices. The returned array has the same shape as the input array x. The return array has default array index data type.

Return type:

usm_ndarray