Could you check your PyTorch version? If I recall correctly, torch.argsort was introduced in 1.0.0.
I would recommend to update in case you are using an older version or you could use torch.sort instead and use the second returned value.