diff --git a/paddle/fluid/operators/distributed/parameter_prefetch.cc b/paddle/fluid/operators/distributed/parameter_prefetch.cc index b7ba938cf100db12eb03b7adc56079957c9dd6f4..327c8cb4dedb61ff50b8239a409c4f25ce699bfc 100644 --- a/paddle/fluid/operators/distributed/parameter_prefetch.cc +++ b/paddle/fluid/operators/distributed/parameter_prefetch.cc @@ -63,7 +63,7 @@ inline std::vector ToAbsoluteSection( inline std::vector> SplitIds( const std::string& id_name, const std::vector& height_section, framework::Scope* scope) { - auto& id_tensor = scope->Var(id_name)->Get(); + auto& id_tensor = scope->FindVar(id_name)->Get(); auto* id_data = id_tensor.data(); std::set all_ids; for (size_t i = 0; i < id_tensor.numel(); ++i) { @@ -111,14 +111,15 @@ inline void MergeMultipleVarsIntoOnBySection( auto cpu_place = platform::CPUPlace(); auto abs_sections = ToAbsoluteSection(height_section); - auto& id_tensor = scope->Var(id_name)->Get(); + auto& id_tensor = scope->FindVar(id_name)->Get(); auto* id_data = id_tensor.data(); std::unordered_map> id_to_offset; for (size_t i = 0; i < id_tensor.numel(); ++i) { id_to_offset[id_data[i]].push_back(i); } - auto* out_tensor = scope->Var(out_name)->GetMutable(); + auto* out_tensor = + scope->FindVar(out_name)->GetMutable(); auto* out_tensor_data = out_tensor->mutable_data(context.GetPlace()); for (size_t section_idx = 0; section_idx < out_var_names.size(); diff --git a/paddle/fluid/operators/lookup_table_op.h b/paddle/fluid/operators/lookup_table_op.h index 4adb829f20fbe4080495568cb18a2df3a5a73a8b..223de413b2152329eef23a156df6d79ea48c02e0 100644 --- a/paddle/fluid/operators/lookup_table_op.h +++ b/paddle/fluid/operators/lookup_table_op.h @@ -56,7 +56,8 @@ class LookupTableKernel : public framework::OpKernel { context.Attr>("height_sections"); if (remote_prefetch) { -// if emap is not empty, then the paramter will be fetched from remote parameter +// if emap is not empty, then the parameter will be fetched from remote +// parameter // server #ifdef PADDLE_WITH_DISTRIBUTE operators::distributed::prefetch(id_name, out_name, table_name, epmap,