From b2f05bf8d8fa88557b258bce94200136556b9f4a Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 13 Jul 2020 15:10:28 +0800 Subject: [PATCH] fix(mge/module): fix quantized fold weight value range limit for fused conv/bn modules GitOrigin-RevId: 007c2f13b68575fcf63324f9e87e9d69bab83fc1 --- python_module/megengine/module/qat/conv_bn.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python_module/megengine/module/qat/conv_bn.py b/python_module/megengine/module/qat/conv_bn.py index b62270b61..38e120521 100644 --- a/python_module/megengine/module/qat/conv_bn.py +++ b/python_module/megengine/module/qat/conv_bn.py @@ -62,6 +62,7 @@ class _ConvBnActivation2d(Float._ConvBnActivation2d, QATModule): self.conv.groups, -1, 1, 1, 1 ) + w_fold = self.apply_quant_weight(w_fold) # b_fold = gamma * (b - bn_mean) / bn_std + beta b_fold = beta + gamma * (conv_bias - bn_mean) * bn_istd return w_fold, b_fold -- GitLab