diff --git a/paddle/fluid/operators/print_op.cc b/paddle/fluid/operators/print_op.cc index 80faf833be591d0f4e2e7ee365d0163869672c02..c558f1852f54c3b91cff024cf78eece491843907 100644 --- a/paddle/fluid/operators/print_op.cc +++ b/paddle/fluid/operators/print_op.cc @@ -13,6 +13,7 @@ limitations under the License. */ #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/operators/tensor_formatter.h" namespace paddle { @@ -173,3 +174,11 @@ REGISTER_OPERATOR(print, ops::PrintOp, ops::PrintOpProtoAndCheckMaker, ops::PrintOpGradientMaker, ops::PrintOpGradientMaker, ops::PrintOpInferShape, ops::PrintOpVarTypeInference); + +REGISTER_OP_VERSION(print) + .AddCheckpoint( + R"ROC(Upgrade print add a new attribute [print_tensor_layout] to " + "contorl whether to print tensor's layout.)ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "print_tensor_layout", "Whether to print the tensor's layout.", + true));