From 7c1f69bdf0c092e2813e38eeca2c5e6b170414e7 Mon Sep 17 00:00:00 2001 From: hutuxian Date: Wed, 30 Dec 2020 16:16:20 +0800 Subject: [PATCH] add op_version for flip op [test=op_version] (#30019) --- paddle/fluid/operators/flip_op.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/flip_op.cc b/paddle/fluid/operators/flip_op.cc index fc17657594b..d7ed5fb767c 100644 --- a/paddle/fluid/operators/flip_op.cc +++ b/paddle/fluid/operators/flip_op.cc @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/fluid/operators/flip_op.h" - #include #include #include +#include "paddle/fluid/framework/op_version_registry.h" namespace paddle { namespace operators { @@ -154,3 +154,12 @@ REGISTER_OP_CPU_KERNEL( ops::FlipKernel, ops::FlipKernel, ops::FlipKernel); + +/* ========================== register checkpoint ===========================*/ +REGISTER_OP_VERSION(flip) + .AddCheckpoint( + R"ROC(Upgrade flip, add new attr [axis] and delete attr [dims].)ROC", + paddle::framework::compatible::OpVersionDesc() + .NewAttr("axis", "The added attr 'axis' doesn't set default value.", + boost::none) + .DeleteAttr("dims", "The attr 'dims' is deleted.")); -- GitLab