Skip to content

Commit c509c82

Browse files
authored
Fix range in data flow analysis (#10865)
* fix range in data flow analysis
1 parent 5674409 commit c509c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/paddle/fluid/transpiler/memory_optimization_transpiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _dataflow_analyze(self):
107107
# Repeatedly apply liveness updates until the algorithm stablize
108108
# on a complete set live input vars and live output vars.
109109
while True:
110-
for i in range(self.op_size, 0, -1):
110+
for i in reversed(range(self.op_size)):
111111
live_in[i] = set(self._live_in[i])
112112
live_out[i] = set(self._live_out[i])
113113
for s in self._successors[i]:

0 commit comments

Comments
 (0)