Skip to content

Commit 2995f74

Browse files
authored
fix error of QuantizationTransformPassV2 when has condition block (#48190)
* fix error of QuantizationTransformPassV2 when has condition block * fix error
1 parent d6b94d2 commit 2995f74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

python/paddle/fluid/contrib/slim/quantization/quantization_pass.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,11 +2481,6 @@ def __init__(
24812481
self.create_var_map = {}
24822482
self.create_op_map = {}
24832483

2484-
# marked the variable which has been dequantized.
2485-
self.dequantized_vars = collections.OrderedDict()
2486-
self.persistable_vars = []
2487-
self.processed_vars = []
2488-
24892484
def _quant_preprocess(self, op_node):
24902485
user_skipped = False
24912486
if isinstance(self._skip_pattern, list):
@@ -2627,6 +2622,10 @@ def apply(self, graph):
26272622
), 'graph must be the instance of IrGraph.'
26282623
if self._is_test is None:
26292624
self._is_test = graph.is_test()
2625+
# marked the variable which has been dequantized.
2626+
self.dequantized_vars = collections.OrderedDict()
2627+
self.persistable_vars = []
2628+
self.processed_vars = []
26302629

26312630
self.persistable_vars = [
26322631
p.name() for p in graph.all_persistable_nodes()

0 commit comments

Comments
 (0)