未验证 提交 d2360332 编写于 作者: C chengduo 提交者: GitHub

Remove compile from PE (#19080)

* remove compile from PE
test=develop
上级 88f111f8
...@@ -240,8 +240,6 @@ class CompiledProgram(object): ...@@ -240,8 +240,6 @@ class CompiledProgram(object):
"share_vars_from is not compiled and run, so there is no " "share_vars_from is not compiled and run, so there is no "
"var to share.") "var to share.")
self._local_scopes = self._share_vars_from._executor.local_scopes() self._local_scopes = self._share_vars_from._executor.local_scopes()
# drop the local_exe_scopes of the previous parallel_executor
self._share_vars_from._executor.drop_local_exe_scopes()
else: else:
assert scope is not None, "" assert scope is not None, ""
self._local_scopes = [] self._local_scopes = []
......
...@@ -163,6 +163,7 @@ class ParallelExecutor(object): ...@@ -163,6 +163,7 @@ class ParallelExecutor(object):
assert isinstance( assert isinstance(
share_vars_from, ParallelExecutor share_vars_from, ParallelExecutor
), "The share_vars_from should be ParallelExecutor." ), "The share_vars_from should be ParallelExecutor."
self._compiled_program.with_data_parallel( self._compiled_program.with_data_parallel(
loss_name=loss_name, loss_name=loss_name,
build_strategy=build_strategy, build_strategy=build_strategy,
...@@ -172,7 +173,6 @@ class ParallelExecutor(object): ...@@ -172,7 +173,6 @@ class ParallelExecutor(object):
self._place = core.CUDAPlace(0) if use_cuda else core.CPUPlace() self._place = core.CUDAPlace(0) if use_cuda else core.CPUPlace()
self._exe = executor.Executor(self._place) self._exe = executor.Executor(self._place)
self._compiled_program._compile(place=self._place, scope=self._scope)
def run(self, fetch_list, feed=None, feed_dict=None, return_numpy=True): def run(self, fetch_list, feed=None, feed_dict=None, return_numpy=True):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册