test=develop
revert-15207-remove_op_handle_lock_and_fix_var
Xin Pan 6 years ago
parent 7526ac14e3
commit 8e2a592be2

@ -101,6 +101,10 @@ class CompiledProgram(object):
self._exec_strategy = exec_strategy
self._loss_name = loss_name
self._share_vars_from = share_vars_from
if self._exec_strategy is None:
self._exec_strategy = ExecutionStrategy()
if self._build_strategy is None:
self._build_strategy = BuildStrategy()
return self
def _with_distributed(self):
@ -124,12 +128,6 @@ class CompiledProgram(object):
else:
self._local_scopes = []
self._places = []
if self._exec_strategy is None:
self._exec_strategy = ExecutionStrategy()
if self._build_strategy is None:
self._build_strategy = BuildStrategy()
self._exec_strategy.use_cuda = isinstance(self._place, core.CUDAPlace)
if self._exec_strategy.use_cuda:
gpus_env = os.getenv("FLAGS_selected_gpus")
@ -194,6 +192,7 @@ class CompiledProgram(object):
if place and self._place != place:
raise ValueError("Cannot compile with different place")
return self
self._compiled = True
self._scope = scope
self._place = place

Loading…
Cancel
Save