mlx_rs::ops::indexing

Function argpartition

Source
pub fn argpartition(a: impl AsRef<Array>, kth: i32, axis: i32) -> Result<Array>
Expand description

Returns the indices that partition the array.

The ordering of the elements within a partition in given by the indices is undefined.

See argpartition_all for the flattened array.

ยงParams

  • a: The input array.
  • kth: Element index at the kth position in the output will give the sorted position. All indices before the kth position will be of elements less or equal to the element at the kth index and all indices after will be of elements greater or equal to the element at the kth index.
  • axis: Axis to partition over