Histc
histc(input, bins=100, min=0, max=0, out=NULL) -> Tensor
Computes the histogram of a tensor.
The elements are sorted into equal width bins between min
and
max
. If min
and max
are both zero, the minimum and
maximum values of the data are used.
Examples
if (torch_is_installed()) {
torch_histc(torch_tensor(c(1., 2, 1)), bins=4, min=0, max=3)
}
#> torch_tensor
#> 0
#> 2
#> 1
#> 0
#> [ CPUFloatType{4} ]