From b1495c2f3a023461369802d102a63b37f2903916 Mon Sep 17 00:00:00 2001 From: yaoxuefeng6 Date: Thu, 12 Nov 2020 13:45:03 +0800 Subject: [PATCH] add datanorm op new scale_w register --- paddle/fluid/operators/data_norm_op.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paddle/fluid/operators/data_norm_op.cc b/paddle/fluid/operators/data_norm_op.cc index 5df2bbdf95144d..45e77a99e6b3eb 100644 --- a/paddle/fluid/operators/data_norm_op.cc +++ b/paddle/fluid/operators/data_norm_op.cc @@ -19,6 +19,7 @@ limitations under the License. */ #ifdef PADDLE_WITH_MKLDNN #include "paddle/fluid/platform/mkldnn_helper.h" #endif +#include "paddle/fluid/framework/op_version_registry.h" namespace paddle { namespace operators { @@ -755,3 +756,10 @@ REGISTER_OP_CPU_KERNEL( data_norm_grad, ops::DataNormGradKernel, ops::DataNormGradKernel); +REGISTER_OP_VERSION(data_norm) + .AddCheckpoint( + R"ROC( + upgrad data_norm op by adding scale_w to support scale and shift.)ROC", + paddle::framework::compatible::OpVersionDesc().NewInput( + "scale_w", + "scale_w is used to do scale duirng data_norm like batchnorm "));