From 13295d90d967328b75e80a04ee35d6fd7cc9fba8 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Tue, 23 Apr 2019 19:25:41 +0800 Subject: [PATCH] load persistables with selected rows, test=develop (#17047) --- paddle/fluid/inference/io.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/io.cc b/paddle/fluid/inference/io.cc index ae72a74ac..8b379457a 100644 --- a/paddle/fluid/inference/io.cc +++ b/paddle/fluid/inference/io.cc @@ -85,7 +85,12 @@ void LoadPersistables(framework::Executor* executor, framework::Scope* scope, new_var->SetShape(var->GetShape()); new_var->SetDataType(var->GetDataType()); new_var->SetType(var->GetType()); - new_var->SetLoDLevel(var->GetLoDLevel()); + + if (var->GetType() != + framework::proto::VarType::Type::VarType_Type_SELECTED_ROWS) { + new_var->SetLoDLevel(var->GetLoDLevel()); + } + new_var->SetPersistable(true); if (!param_filename.empty()) { -- GitLab