Return the n largest values of tensor Z, sorted ascending.
n
Z
Input
Z = tensor([3, 1, 4, 1, 5, 9, 2, 6]) n = 3
Output
tensor([5, 6, 9])
This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.
solve(...)