mindspore.ops.histc
- mindspore.ops.histc(input, bins=100, min=0., max=0.)[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 or higher than max are ignored.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([1., 1, 2, 2, 2, 5, 8]) >>> output = mindspore.ops.histc(input, bins=5, min=0, max=9) >>> print(output) [2. 3. 1. 0. 1.]