mlx_rs::ops::indexingFunction topk_device
Source pub fn topk_device(
a: impl AsRef<Array>,
k: i32,
axis: impl Into<Option<i32>>,
stream: impl AsRef<Stream>,
) -> Result<Array>
Expand description
Returns the k
largest elements from the input along a given axis.
The elements will not necessarily be in sorted order.
See topk_all
for the flattened array.
ยงParams
a
: The input array.
k
: The number of elements to return.
axis
: Axis to sort over. Default to -1
if not specified.