|
|
|
|
@ -178,8 +178,8 @@ void TestInference(const std::string& dirname,
|
|
|
|
|
std::unique_ptr<paddle::framework::ExecutorPrepareContext> ctx;
|
|
|
|
|
if (PrepareContext) {
|
|
|
|
|
ctx = executor.Prepare(*inference_program, 0);
|
|
|
|
|
executor.RunPreparedContext(ctx.get(), scope, feed_targets,
|
|
|
|
|
fetch_targets);
|
|
|
|
|
executor.RunPreparedContext(ctx.get(), scope, feed_targets, fetch_targets,
|
|
|
|
|
CreateVars);
|
|
|
|
|
} else {
|
|
|
|
|
executor.Run(*inference_program, scope, feed_targets, fetch_targets,
|
|
|
|
|
CreateVars);
|
|
|
|
|
@ -198,7 +198,7 @@ void TestInference(const std::string& dirname,
|
|
|
|
|
// Note: if you changed the inference_program, you need to call
|
|
|
|
|
// executor.Prepare() again to get a new ExecutorPrepareContext.
|
|
|
|
|
executor.RunPreparedContext(ctx.get(), scope, feed_targets,
|
|
|
|
|
fetch_targets);
|
|
|
|
|
fetch_targets, CreateVars);
|
|
|
|
|
} else {
|
|
|
|
|
executor.Run(*inference_program, scope, feed_targets, fetch_targets,
|
|
|
|
|
CreateVars);
|
|
|
|
|
|