mlx_rs::opsFunction argsort
Source pub fn argsort(a: impl AsRef<Array>, axis: i32) -> Result<Array>
Expand description
Returns the indices that sort the array. Returns an error if the arguments are invalid.
§Params
a
: The array to sort.
axis
: axis to sort over
§Example
use mlx_rs::{Array, ops::*};
let a = Array::from_slice(&[3, 2, 1], &[3]);
let axis = 0;
let result = argsort(&a, axis);