From 8e2a592be29da1ee045b3c11ba4484a5f71957e0 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Sun, 6 Jan 2019 15:13:12 +0800 Subject: [PATCH] fix test=develop --- python/paddle/fluid/compiler.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/compiler.py b/python/paddle/fluid/compiler.py index 1e6714479d..7e0ef8d150 100644 --- a/python/paddle/fluid/compiler.py +++ b/python/paddle/fluid/compiler.py @@ -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 -- GitLab