refine executor bug info (#19887)

test=develop
expand_as_op_1
chengduo 6 years ago committed by GitHub
parent ae593e57fa
commit 1f68674483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -621,11 +621,15 @@ class Executor(object):
if self._closed:
raise RuntimeError("Attempted to use a closed Executor")
use_default_main_program = program is None
if program is None:
program = default_main_program()
if isinstance(program,Program) and \
if isinstance(program, Program) and \
len(program.global_block().ops) == 0:
warnings.warn("The current program is empty.")
error_info = "The current program is empty."
if use_default_main_program:
error_info += " Maybe you should pass the Program or the CompiledProgram manually."
warnings.warn(error_info)
if scope is None:
scope = global_scope()

Loading…
Cancel
Save