mlx_rs::opsFunction argsort_device
Source pub fn argsort_device(
a: impl AsRef<Array>,
axis: i32,
stream: impl AsRef<Stream>,
) -> 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);