diff --git a/python/paddle/fluid/compiler.py b/python/paddle/fluid/compiler.py index c9885b43b804f086cd72a55dc13dca2059f7ce7f..a258ad76cd27dfe76ca0ef9a3031aff5dc90cf76 100644 --- a/python/paddle/fluid/compiler.py +++ b/python/paddle/fluid/compiler.py @@ -178,9 +178,9 @@ class CompiledProgram(object): # FIXME(dzhwinter): enable_inplace should be after memory_optimize # if turn on python memory optimize, turn off the inplace_pass. if self._build_strategy.memory_optimize is True: - self._build_strategy.memory_optimize = False if main._is_mem_optimized else True + self._build_strategy.memory_optimize = False if self._program._is_mem_optimized else True if self._build_strategy.enable_inplace is True: - self._build_strategy.enable_inplace = False if main._is_mem_optimized else True + self._build_strategy.enable_inplace = False if self._program._is_mem_optimized else True if self._build_strategy.num_trainers > 1 and trainers_endpoints: assert self._build_strategy.num_trainers == len(