From 5a03b515ae6d7f96c6a7e451fc0607bee5632e00 Mon Sep 17 00:00:00 2001 From: chengduo Date: Wed, 13 Feb 2019 20:32:05 -0600 Subject: [PATCH] fix potential bug in async_executor (#15707) test=develop --- paddle/fluid/framework/async_executor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/framework/async_executor.cc b/paddle/fluid/framework/async_executor.cc index 1d9678a1ba1..60708bf609d 100644 --- a/paddle/fluid/framework/async_executor.cc +++ b/paddle/fluid/framework/async_executor.cc @@ -244,6 +244,7 @@ void AsyncExecutor::RunFromFile(const ProgramDesc& main_program, auto& block = main_program.Block(0); for (auto var_name : fetch_var_names) { auto var_desc = block.FindVar(var_name); + PADDLE_ENFORCE_NOT_NULL(var_desc, "%s is not found.", var_name); auto shapes = var_desc->GetShape(); PADDLE_ENFORCE(shapes[shapes.size() - 1] == 1, "var %s: Fetched var has wrong shape, " -- GitLab