diff --git a/paddle/fluid/operators/linspace_op.cc b/paddle/fluid/operators/linspace_op.cc index 7cc07383bfa5f67a2404b220cb481d9017b40fd8..fe271fa5e893a750bdbbdc05ac4b7835205ebe66 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));