diff --git a/paddle/fluid/operators/allclose_op.cc b/paddle/fluid/operators/allclose_op.cc index cd83443f0522f7453da556bc63cf280b4d6a6a61..fe6c3c9adcc6e875fcb6a807a7b0ca70c95dc6b4 100644 --- a/paddle/fluid/operators/allclose_op.cc +++ b/paddle/fluid/operators/allclose_op.cc @@ -15,6 +15,7 @@ #include "paddle/fluid/operators/allclose_op.h" #include #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/framework/operator.h" #include "paddle/fluid/platform/enforce.h" @@ -153,3 +154,28 @@ REGISTER_OPERATOR( ops::AllcloseOpVarTypeInference); REGISTER_OP_CPU_KERNEL(allclose, ops::AllcloseKernel, ops::AllcloseKernel); + +/* ========================== register checkpoint ===========================*/ +REGISTER_OP_VERSION(allclose) + .AddCheckpoint( + R"ROC(Upgrade allclose, add two new inputs [Rtol] and [Atol].)ROC", + paddle::framework::compatible::OpVersionDesc() + .NewInput("Rtol", + "The added input 'Rtol' is not" + "dispensable.") + .NewInput("Atol", + "The added input 'Atol' is not" + "dispensable.")) + .AddCheckpoint( + R"ROC(Delete two attributes [rtol] and [atol])ROC", + paddle::framework::compatible::OpVersionDesc() + .DeleteAttr("rtol", + "The attribute 'rtol' is deleted." + "The reason why it is deleted is that" + "attributes do not support a float64 value" + "and it is changed to a tensor.") + .DeleteAttr("atol", + "The attribute 'atol' is deleted." + "The reason why it is deleted is that" + "attributes do not support a float64 value" + "and it is changed to a tensor."));