Sort the rows of matrix Z by the values in its n-th column. Return the sorted matrix.
Z
n
Input
Z = tensor([[3, 7, 1], [1, 2, 9], [2, 5, 5]]) n = 1
Output
tensor([[1, 2, 9], [2, 5, 5], [3, 7, 1]])
This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.
solve(...)