bincount(input: Tensor, weights: Tensor | None = None, minlength: int = 0)Count occurrences of each integer value in input.
Parameters
inputTensor1-D non-negative integer tensor. Negative values raise.
Same length as
input. When supplied, output[i] is the
sum of weights for entries with value i (rather than the
plain count). Default None.minlengthint= 0Floor for the output length. The output has length
max(input.max() + 1, minlength). Default 0.Returns
Tensor1-D tensor; dtype is float when weights is given, otherwise
int64.
Raises
ValueErrorIf
input contains negative values.