torch.bincount
- torch.bincount(input, weights=None, minlength=0) → Tensor
Count the frequency of each value in an array of non-negative ints.
The number of bins (size 1) is one larger than the largest value in
unless is empty, in which case the result is a tensor of size 0. If is specified, the number of bins is at least and if is empty, then the result is tensor of size filled with zeros. If is the value at position , if is specified else .