From 77a8c94b6853483bee577c34aa1c886044b2f47a Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Tue, 9 Nov 2021 14:13:15 +0800 Subject: [PATCH] fix CompileProgram in Executor (#37036) --- python/paddle/fluid/executor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index c6649a615ad..4d731b2a171 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1301,9 +1301,13 @@ class Executor(object): # NOTE: This is an experimental feature. If `export FLAGS_USE_STANDALONE_EXECUTOR=1 `, # use StandaloneExecutor to run the program. - if self._enable_interpreter_core and not program._is_start_up_program_: - return self._executor_cache.run(program, scope, feed, fetch_list, - return_numpy) + if self._enable_interpreter_core: + inner_program_ = program._program if isinstance( + program, compiler.CompiledProgram) else program + assert isinstance(inner_program_, framework.Program) + if not program._is_start_up_program_: + return self._executor_cache.run(program, scope, feed, + fetch_list, return_numpy) # use_prune can be overrided by putting optimize_ops in fetch_list _origin_fetch_list = fetch_list -- GitLab