|
|
|
@ -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()
|
|
|
|
|