histogram¶
- paddle. histogram ( input, bins=100, min=0, max=0, name=None ) [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. - Parameters
- 
           - input (Tensor) – A Tensor(or LoDTensor) with shape \([N_1, N_2,..., N_k]\) . The data type of the input Tensor should be float32, float64, int32, int64. 
- bins (int, optional) – number of histogram bins. 
- min (int, optional) – lower end of the range (inclusive). 
- max (int, optional) – upper end of the range (inclusive). 
- name (str, optional) – For details, please refer to Name. Generally, no setting is required. Default: None. 
 
- Returns
- 
           data type is int64, shape is (nbins,). 
- Return type
- 
           Tensor 
 Examples import paddle inputs = paddle.to_tensor([1, 2, 1]) result = paddle.histogram(inputs, bins=4, min=0, max=3) print(result) # [0, 2, 1, 0] 
