From 57dab959ca53a42ad1bccd8fd0344f32e2074a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Tue, 17 Nov 2020 10:30:49 +0800 Subject: [PATCH] add datanorm op new scale_w register (#28657) Co-authored-by: yaoxuefeng6 --- 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 5df2bbdf95..45e77a99e6 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 ")); -- GitLab