Skip to content

Commit 697145c

Browse files
committed
Merge pull request #14055 from dzhwinter/fix/mem_opt
OrderSet default is mutableSet, not set. test=release/1.1
1 parent 043f450 commit 697145c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/paddle/fluid/transpiler/memory_optimization_transpiler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _dataflow_analyze(self):
171171
self._live_out[i] |= self._live_in[s]
172172
self._live_in[i] = self._uses[i] | (
173173
self._live_out[i] - self._defs[i])
174-
if live_in[i] != self._live_in[i]:
174+
if live_in[i] != set(self._live_in[i]):
175175
for d in self._presuccessors[i]:
176176
worklist.append(d)
177177

@@ -321,8 +321,7 @@ def compare_shape(x_shape, cache_shape, opt_level):
321321

322322
if not compare_shape(x_shape, cache_shape, level):
323323
continue
324-
# TODO(qijun): actually, we should compare
325-
# dtype_to_size[x_dtype] and dtype_to_size[cache_dtype]
324+
# TODO(qijun): dtype_to_size[x_dtype] and dtype_to_size[cache_dtype]
326325
if x_dtype != cache_dtype:
327326
continue
328327

@@ -487,7 +486,6 @@ def memory_optimize(input_program,
487486
skip_opt_set = grad_set
488487
else:
489488
skip_opt_set.update(grad_set)
490-
491489
cfgs = _get_cfgs(input_program)
492490
for cfg in cfgs:
493491
cfg.memory_optimize(skip_opt_set=skip_opt_set, level=level)

0 commit comments

Comments
 (0)