dpnp.tensor.sort

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

Returns a sorted copy of an input array x.

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 -- A sorted array. The returned array has the same data type and the same shape as the input array x.

Return type:

usm_ndarray