Register op version for print, test=op_version (#29945)

revert-31562-mean
Qi Li 5 years ago committed by GitHub
parent f4be9d6a32
commit 913f77a4b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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<paddle::framework::OpDesc>,
ops::PrintOpGradientMaker<paddle::imperative::OpBase>,
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));

Loading…
Cancel
Save