观测器

观测器#

\begin{array}{ll} x_\text{min} &= \begin{cases} \min(X) & \text{if~}x_\text{min} = \text{None} \ \min\left(x_\text{min}, \min(X)\right) & \text{otherwise} \end{cases}\ x_\text{max} &= \begin{cases} \max(X) & \text{if~}x_\text{max} = \text{None} \ \max\left(x_\text{max}, \max(X)\right) & \text{otherwise} \end{cases}\ \end{array}

PerChannelMinMaxObserver.with_args(
    dtype=torch.qint8, qscheme=torch.per_channel_symmetric
)
qconfig = QConfig(activation=HistogramObserver.with_args(reduce_range=False),
                  weight=MinMaxObserver.with_args(dtype=torch.qint8, qscheme=torch.per_tensor_symmetric))