未验证 提交 2995f742 编写于 作者: G Guanghua Yu 提交者: GitHub

fix error of QuantizationTransformPassV2 when has condition block (#48190)

* fix error of QuantizationTransformPassV2 when has condition block

* fix error
上级 d6b94d26
......@@ -2481,11 +2481,6 @@ class QuantizationTransformPassV2(QuantizationTransformPass):
self.create_var_map = {}
self.create_op_map = {}
# marked the variable which has been dequantized.
self.dequantized_vars = collections.OrderedDict()
self.persistable_vars = []
self.processed_vars = []
def _quant_preprocess(self, op_node):
user_skipped = False
if isinstance(self._skip_pattern, list):
......@@ -2627,6 +2622,10 @@ class QuantizationTransformPassV2(QuantizationTransformPass):
), 'graph must be the instance of IrGraph.'
if self._is_test is None:
self._is_test = graph.is_test()
# marked the variable which has been dequantized.
self.dequantized_vars = collections.OrderedDict()
self.persistable_vars = []
self.processed_vars = []
self.persistable_vars = [
p.name() for p in graph.all_persistable_nodes()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册