HistogramObserver#

class HistogramObserver(bins=2048, upsample_rate=128, mode=QuantMode.SYMMERTIC, eps=0.00001, dtype='qint8', **kwargs)[源代码]#

一个使用滑动直方图统计算法更新最小、最大值的 MinMaxObserver.

参数:
  • bins (int) – 直方图的格数

  • upsample_rate (int) – 上采样率

  • mode (QuantMode) – 量化模式

  • eps (float) – 最大值的初始值,防止除 0 错误的发生。

  • dtype (Union[str, QuantDtypeMeta]) – 字符串,表明按何种数据类型来收集 scale 和 zero_point.