import torch
a = torch.rand(3, 4)
print(a)
b = torch.argsort(a)
print(b)
However, I get
tensor([[0.4143, 0.4293, 0.9506, 0.2267],
[0.8637, 0.8718, 0.2595, 0.2888],
[0.6663, 0.6066, 0.8233, 0.6793]])
tensor([[3, 0, 1, 2],
[2, 3, 0, 1],
[1, 0, 3, 2]])
For the first line, why the smallest value 0.2267
accords with 2
in b, which seems strange.
My pytorch version is 1.5.