mindspore.mint.histc
- mindspore.mint.histc(input, bins=100, min=0, max=0)[source]
Compute 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.
Warning
If input is mindspore.int64, valid values fit within mindspore.int32; exceeding this may cause precision errors.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> x = mindspore.tensor([1., 2, 1]) >>> y = mindspore.mint.histc(x, bins=4, min=0, max=3) >>> print(y) [0. 2. 1. 0.]