未验证 提交 5c71cc90 编写于 作者: C Chang Xu 提交者: GitHub

Add condition in Dygraph/QAT (#1370)

上级 0fdbc80e
...@@ -243,8 +243,8 @@ class QAT(object): ...@@ -243,8 +243,8 @@ class QAT(object):
""" """
assert isinstance(model, paddle.nn.Layer), \ assert isinstance(model, paddle.nn.Layer), \
"The model must be the instance of paddle.nn.Layer." "The model must be the instance of paddle.nn.Layer."
if self.weight_preprocess is not None or self.act_preprocess is not None:
self._model = copy.deepcopy(model) self._model = copy.deepcopy(model)
if inplace: if inplace:
quantize_model = self.imperative_qat.quantize(model) quantize_model = self.imperative_qat.quantize(model)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册