File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,6 @@ def __init__(self,
135
135
# step3: init build_strategy
136
136
if build_strategy is None :
137
137
build_strategy = BuildStrategy ()
138
- build_strategy .enable_inplace = False if main ._is_optimized else True
139
138
build_strategy .num_trainers = num_trainers
140
139
build_strategy .trainer_id = trainer_id
141
140
# FIXME(zcd): is_distribution_ is a temporary field, because in pserver mode,
@@ -147,6 +146,9 @@ def __init__(self,
147
146
# step4: get main_program, scope, local_scopes
148
147
main = main_program if main_program \
149
148
else framework .default_main_program ()
149
+ # FIXME(dzhwinter): enable_inplace should be after memory_optimize
150
+ # if turn on python memory optimize, turn off the inplace_pass.
151
+ build_strategy .enable_inplace = False if main ._is_optimized else True
150
152
scope = scope if scope is not None else executor .global_scope ()
151
153
152
154
if share_vars_from and not isinstance (share_vars_from ,
You can’t perform that action at this time.
0 commit comments