dpctl.tensor.argsort

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

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

Parameters:
  • x (usm_ndarray) – input array.

  • axis (Optional[int]) – axis along which to sort. If set to -1, the function must sort along the last axis. Default: -1.

  • descending (Optional[bool]) – 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 (Optional[bool]) – 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.

Returns:

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