未验证 提交 07126112 编写于 作者: X XGZhang 提交者: GitHub

fix a quantization bug (#35407)

上级 cec1abc3
......@@ -202,7 +202,7 @@ class ImperativeQuantAware(object):
self._quantize_inputs = ImperativeQuantizeInputs(**kwargs)
self._quantize_outputs = ImperativeQuantizeOutputs()
self._quantize_outputs = ImperativeQuantizeOutputs(moving_rate)
def quantize(self, model):
"""
......@@ -413,6 +413,8 @@ class ImperativeQuantizeOutputs(object):
"The model must be the instance of dygraph.Layer."
for cur_name, cur_layer in model.named_sublayers():
if '_act_preprocess' in cur_name:
continue
if not self._is_target_layer(cur_layer):
continue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册