If I have not misunderstood the function definition, a.argsort() would give the index of the ordered array.

In this case, the tensor is [-0.3868, -1.0274, 2.1992, 0.2730, -0.7430, -1.2569, -0.9533, 0.4771, -1.5247, -0.0411, -0.9043, 0.2035], and the smallest element of it is -1.5247 with index 7. However, the first element of the output index array of a.argsort() is 8, the corresponding element of which in the array is -0.0411. I thinks this is not correct, since the smallest element is the 7th, and the output of a.argsort() should be [7, ...].

yes, the 7th is 0.4771 which is the neither the largest nor the smallest value in the given array.since the largest is the one with index 2(count from 0) with value 2.1992 and the smallest is the one of index 8 with value -1.5247.