|
|
|
@ -170,10 +170,15 @@ void ThreadedSSAGraphExecutor::InsertFetchOps(
|
|
|
|
for (size_t i = 0; i < fetch_tensors.size(); ++i) {
|
|
|
|
for (size_t i = 0; i < fetch_tensors.size(); ++i) {
|
|
|
|
auto &var_name = fetch_tensors[i];
|
|
|
|
auto &var_name = fetch_tensors[i];
|
|
|
|
auto fetched_var_it = fetched_vars.find(var_name);
|
|
|
|
auto fetched_var_it = fetched_vars.find(var_name);
|
|
|
|
PADDLE_ENFORCE(fetched_var_it != fetched_vars.end(),
|
|
|
|
PADDLE_ENFORCE_NE(
|
|
|
|
"Cannot find fetched variable(%s).(Perhaps the main_program "
|
|
|
|
fetched_var_it, fetched_vars.end(),
|
|
|
|
"is not set to ParallelExecutor)",
|
|
|
|
platform::errors::PreconditionNotMet(
|
|
|
|
var_name);
|
|
|
|
"Cannot find fetched variable(%s) in current computation graph. "
|
|
|
|
|
|
|
|
"Possible reasons are:\n"
|
|
|
|
|
|
|
|
" 1. The variable to be fetched is not defined in main program.\n"
|
|
|
|
|
|
|
|
" 2. The variable to be fetched is not an input or output of any "
|
|
|
|
|
|
|
|
"operator.",
|
|
|
|
|
|
|
|
var_name));
|
|
|
|
|
|
|
|
|
|
|
|
auto &vars = fetched_var_it->second;
|
|
|
|
auto &vars = fetched_var_it->second;
|
|
|
|
|
|
|
|
|
|
|
|
|