def histogram(input, bins=100, min=0, max=0, name=None):
    '\n    Computes the histogram of a tensor. The elements are sorted into equal width bins between min and max.\n    If min and max are both zero, the minimum and maximum values of the data are used.\n\n    Args:\n        input (Tensor): A Tensor(or LoDTensor) with shape :math:`[N_1, N_2,..., N_k]` . The data type of the input Tensor\n            should be float32, float64, int32, int64.\n        bins (int): number of histogram bins\n        min (int): lower end of the range (inclusive)\n        max (int): upper end of the range (inclusive)\n\n    Returns:\n        Tensor: data type is int64, shape is (nbins,).\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            inputs = paddle.to_tensor([1, 2, 1])\n            result = paddle.histogram(inputs, bins=4, min=0, max=3)\n            print(result) # [0, 2, 1, 0]\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.histogram(input, 'bins', bins, 'min', min, 'max', max)
    helper = LayerHelper('histogram', **locals())
    check_variable_and_dtype(input, 'X', ['int32', 'int64', 'float32', 'float64'], 'histogram')
    out = helper.create_variable_for_type_inference(VarDesc.VarType.INT64)
    helper.append_op(type='histogram', inputs={'X': input}, outputs={'Out': out}, attrs={'bins': bins, 'min': min, 'max': max})
    return out
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.

Args:
    input (Tensor): A Tensor(or LoDTensor) with shape :math:`[N_1, N_2,..., N_k]` . The data type of the input Tensor
        should be float32, float64, int32, int64.
    bins (int): number of histogram bins
    min (int): lower end of the range (inclusive)
    max (int): upper end of the range (inclusive)

Returns:
    Tensor: data type is int64, shape is (nbins,).

Examples:
    .. code-block:: python

        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]
def histogram(input, bins=100, min=0, max=0, name=None):
    '\n    Computes the histogram of a tensor. The elements are sorted into equal width bins between min and max.\n    If min and max are both zero, the minimum and maximum values of the data are used.\n\n    Args:\n        input (Tensor): A Tensor(or LoDTensor) with shape :math:`[N_1, N_2,..., N_k]` . The data type of the input Tensor\n            should be float32, float64, int32, int64.\n        bins (int): number of histogram bins\n        min (int): lower end of the range (inclusive)\n        max (int): upper end of the range (inclusive)\n\n    Returns:\n        Tensor: data type is int64, shape is (nbins,).\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            inputs = paddle.to_tensor([1, 2, 1])\n            result = paddle.histogram(inputs, bins=4, min=0, max=3)\n            print(result) # [0, 2, 1, 0]\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.histogram(input, 'bins', bins, 'min', min, 'max', max)
    helper = LayerHelper('histogram', **locals())
    check_variable_and_dtype(input, 'X', ['int32', 'int64', 'float32', 'float64'], 'histogram')
    out = helper.create_variable_for_type_inference(VarDesc.VarType.INT64)
    helper.append_op(type='histogram', inputs={'X': input}, outputs={'Out': out}, attrs={'bins': bins, 'min': min, 'max': max})
    return out