Dear ptrblck,
Thanks for your reply. Sure. I simplify my question with changing the dimensions of tensors to 2. Suppose we have these 2 tensors:
hc1 = tensor([[30],
              [20],
              [10],
              [50],
              [40]])

hc2=tensor([[1],
            [2],
            [3],
            [4],
            [5]])

1, 2, 3, 4, 5  are, subsequently, related to 30, 20, 10, 50, 40.
After sorting hc1 we would have 10, 20, 30, 40, 50 and 3, 2, 1, 5, 4. Because hc1 and hc2 are 1 to 1.
I thought that I should concatenate them as hc3 and sort it based on hc1.
I hope that I explained my question as well as possible.
Thanks