From 913f77a4b7a7f408a6725f668bdbe32f1fec9e45 Mon Sep 17 00:00:00 2001 From: Qi Li Date: Mon, 28 Dec 2020 18:01:24 +0800 Subject: [PATCH] Register op version for print, test=op_version (#29945) --- paddle/fluid/operators/print_op.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/operators/print_op.cc b/paddle/fluid/operators/print_op.cc index 80faf833be..c558f1852f 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)); -- GitLab