Every line of 'python argsort descending' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
21 def argsort(seq): 22 return sorted(range(len(seq)),key=seq.__getitem__)
96 def sort(x, dim=None, descending=False): 97 if dim is None: 98 dim = -1 99 ascend = not descending 100 # TODO this isn't an ideal implementation. 101 val = F.sort(x, axis=dim, is_ascend=ascend) 102 idx = F.argsort(x, axis=dim, is_ascend=ascend) 103 idx = F.cast(idx, dtype='int64') 104 return val, idx