pub fn argsort<B, K>(
tensor: <K as TensorKind<B>>::Primitive,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive
Expand description
Returns the indices that sort the elements of the input tensor
along a given dimension.
This sort is unstable (i.e., may reorder equal elements).
§Arguments
tensor
- The input tensor.dim
- The axis along which to sort.descending
- The sorting order.
§Returns
A tensor with the same shape as the input tensor the indices map back to the original input tensor.
§Remarks
This is a fallback solution that used only when the backend doesn’t have the corresponding implementation. Ideally, it is supposed to be implemented by the backend and the backend implementation will be resolved by static dispatch. It is not designed for direct usage by users, and not recommended to import or use this function directly.