diff --git a/paddle/fluid/operators/roll_op.cc b/paddle/fluid/operators/roll_op.cc index 975cf83ffe8bed49a5359a3add009239ce62aa30..b1fe95203636fe96b0e45afdbf040402aa7e9718 100644 --- a/paddle/fluid/operators/roll_op.cc +++ b/paddle/fluid/operators/roll_op.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "paddle/fluid/operators/roll_op.h" - #include #include +#include "paddle/fluid/framework/op_version_registry.h" namespace paddle { namespace operators { @@ -142,3 +142,17 @@ REGISTER_OP_CPU_KERNEL( ops::RollGradKernel, ops::RollGradKernel, ops::RollGradKernel); + +REGISTER_OP_VERSION(roll) + .AddCheckpoint( + R"ROC( + Upgrade roll add 1 attribute [axis], delete 1 attribute[dims]. + )ROC", + paddle::framework::compatible::OpVersionDesc() + .NewAttr("axis", + "(std::vector) Axis along which to roll. " + "It must have the same size with shifts.", + std::vector()) + .DeleteAttr("dims", + "(std::vector) Dims along which to roll. " + "It must have the same size with shifts."));