TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.histc

tensorplay.functional.histc(input, bins=100, min=0, max=0, *, out=None) → Tensor[source]

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.

Elements lower than min and higher than max and NaN elements are ignored.

Parameters:
  • input (Tensor) – the input tensor.

  • bins (int) – number of histogram bins

  • min (Scalar) – lower end of the range (inclusive)

  • max (Scalar) – upper end of the range (inclusive)

Keyword Arguments:

out (Tensor, optional) – the output tensor.

Returns:

Histogram represented as a tensor

Return type:

Tensor

Example:

>>> tensorplay.histc(tensorplay.tensor([1., 2, 1]), bins=4, min=0, max=3)
tensor([ 0.,  2.,  1.,  0.])

On this page

Ask DeepWiki