From 77c1684397284ef5d5f2e013834626c7a7d8be3f Mon Sep 17 00:00:00 2001 From: ceci3 Date: Wed, 30 Dec 2020 14:34:41 +0800 Subject: [PATCH] register ModifyAttr for instance_norm, test=op_version (#29938) * upgrade instance_norm, test=op_version * fix --- paddle/fluid/operators/instance_norm_op.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/paddle/fluid/operators/instance_norm_op.cc b/paddle/fluid/operators/instance_norm_op.cc index 1018adcd93..28643ac1c0 100644 --- a/paddle/fluid/operators/instance_norm_op.cc +++ b/paddle/fluid/operators/instance_norm_op.cc @@ -17,6 +17,7 @@ limitations under the License. */ #include #include #include "paddle/fluid/framework/data_layout.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/operators/math/math_function.h" namespace paddle { @@ -701,3 +702,20 @@ REGISTER_OP_CPU_KERNEL( float>, ops::InstanceNormDoubleGradKernel); + +REGISTER_OP_VERSION(instance_norm) + .AddCheckpoint( + R"ROC( + Change dispensable of attribute from False to True in instance_norm. + )ROC", + paddle::framework::compatible::OpVersionDesc() + .ModifyAttr( + "Bias", + "The arg 'dispensable' of Input 'Bias' is changed: from " + "'False' to 'True'.", + true) + .ModifyAttr( + "Scale", + "The arg 'dispensable' of Input 'Scale' is changed: from " + "'False' to 'True'.", + true));