mlx.core.sort

目錄

mlx.core.sort#

sort(a: array, /, axis: None | int = -1, *, stream: None | Stream | Device = None) array#

Returns a sorted copy of the array.

The sort is stable, meaning equal elements preserve their relative order. NaN values are placed at the end.

參數:
  • a (array) -- 輸入陣列。

  • axis (int or None, optional) -- Optional axis to sort over. If None, this sorts over the flattened array. If unspecified, it defaults to -1 (sorting over the last axis).

回傳值:

The sorted array.

回傳值型別:

array