Sort by first column and use the indices to then sort the whole array: a[a[:, 0].sort()[1]] ... torch.stack(sorted(a, key=lambda a: a[0])).
確定! 回上一頁