From 6e93fb92f962b2df3b4522bebe42174bffa723f6 Mon Sep 17 00:00:00 2001 From: yinhaofeng <66763551+yinhaofeng@users.noreply.github.com> Date: Thu, 31 Dec 2020 09:00:46 -0600 Subject: [PATCH] Register op version for linspace,test=op_version (#30025) * Register op version for linspace,test=op_version * Register op version for linspace,test=op_version * Register op version for linspace,test=op_version * Register op version for linspace,test=op_version * Register op version for linspace,test=op_version --- paddle/fluid/operators/linspace_op.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/operators/linspace_op.cc b/paddle/fluid/operators/linspace_op.cc index 7cc07383bfa..fe271fa5e89 100644 --- a/paddle/fluid/operators/linspace_op.cc +++ b/paddle/fluid/operators/linspace_op.cc @@ -14,6 +14,7 @@ limitations under the License. */ #include "paddle/fluid/operators/linspace_op.h" #include +#include "paddle/fluid/framework/op_version_registry.h" namespace paddle { namespace operators { @@ -92,3 +93,11 @@ REGISTER_OP_CPU_KERNEL(linspace, ops::CPULinspaceKernel, ops::CPULinspaceKernel, ops::CPULinspaceKernel, ops::CPULinspaceKernel); + +REGISTER_OP_VERSION(linspace) + .AddCheckpoint( + R"ROC( + Upgrade linspace to add a new attribute [dtype]. + )ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "dtype", "In order to change output data type ", 5)); -- GitLab