Return the most frequent (mode) value in the non-negative integer tensor Z. If multiple values are tied for most frequent, return the smallest one.
Z
Input
tensor([1, 2, 2, 3, 3, 3, 4])
Output
3
This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.
solve(...)