From 7d1c149e09c035e7f02b880dbbe2d775b1cf11be Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Mon, 4 Jan 2021 17:30:03 +0800 Subject: [PATCH] for inference checkpoint (#30081) * for inference checkpoint Change-Id: I36c979240ffa55bf1ef0c9315402960762af6be4 * for inference checkpoint Change-Id: I82025365d5b792cbea1ead506df685aecc8ac198 --- paddle/fluid/operators/lookup_table_op.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/paddle/fluid/operators/lookup_table_op.cc b/paddle/fluid/operators/lookup_table_op.cc index 57425fe262..1b482235da 100644 --- a/paddle/fluid/operators/lookup_table_op.cc +++ b/paddle/fluid/operators/lookup_table_op.cc @@ -17,6 +17,7 @@ limitations under the License. */ #include #include "paddle/fluid/framework/no_need_buffer_vars_inference.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/framework/var_type_inference.h" namespace paddle { @@ -224,3 +225,16 @@ REGISTER_OP_CPU_KERNEL(lookup_table, ops::LookupTableKernel, ops::LookupTableKernel); REGISTER_OP_CPU_KERNEL(lookup_table_grad, ops::LookupTableGradKernel, ops::LookupTableGradKernel); + +/* ========================== register checkpoint ===========================*/ + +REGISTER_OP_VERSION(lookup_table) + .AddCheckpoint( + R"ROC( + Upgrade lookup_table add 1 attribute [entry_config]. + )ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "entry_config", + "(std::string) embedding sparse feature entry config.", "")); + +/* ========================================================================== */ -- GitLab