Hi Simon,
I think that’s equal to reverse .
I test this idea with the following code:
a=torch.randn(5)
sorted_a,idx=a.sort(0, descending=True)
b=torch.randn(5)
b[idx]=sorted_a
print('a:')
print(a)
print('sorted_a:')
print(sorted_a)
print(b)

The output are as following:
a:

-1.1561
 1.8450
 0.1463
 0.0551
 1.0577
[torch.FloatTensor of size 5]

sorted_a:

 1.8450
 1.0577
 0.1463
 0.0551
-1.1561
[torch.FloatTensor of size 5]


-1.1561
 1.8450
 0.1463
 0.0551
 1.0577
[torch.FloatTensor of size 5]

Note that b==a, which means that we unordered the sorted_a with sort index idx.