Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions paddle/fluid/operators/allclose_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "paddle/fluid/operators/allclose_op.h"
#include <cmath>
#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"

Expand Down Expand Up @@ -153,3 +154,28 @@ REGISTER_OPERATOR(
ops::AllcloseOpVarTypeInference);
REGISTER_OP_CPU_KERNEL(allclose, ops::AllcloseKernel<CPU, float>,
ops::AllcloseKernel<CPU, double>);

/* ========================== 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."));