On this page
torch.histc
torch.histc(input, bins=100, min=0, max=0, *, out=None) → Tensor
-
Computes the histogram of a tensor.
The elements are sorted into equal width bins between
min
andmax
. Ifmin
andmax
are both zero, the minimum and maximum values of the data are used.Elements lower than min and higher than max are ignored.
- Parameters:
- Keyword Arguments:
-
out (Tensor, optional) – the output tensor.
- Returns:
-
Histogram represented as a tensor
- Return type:
Example:
>>> torch.histc(torch.tensor([1., 2, 1]), bins=4, min=0, max=3) tensor([ 0., 2., 1., 0.])
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.histc.html