megengine.functional.argsort#
- argsort(inp, descending=False)[source]#
Returns the indices that would sort the input tensor.
- Parameters:
- Return type:
- Returns:
indices of int32 indicates how to sort the input.
Examples
>>> import numpy as np >>> x = Tensor(np.array([1,2], dtype=np.float32)) >>> F.argsort(x) Tensor([0 1], dtype=int32, device=xpux:0)