From 7907e2416e4b36f6bdad703aa3541ea6fe8fafda Mon Sep 17 00:00:00 2001 From: XiangGao Date: Tue, 7 Sep 2021 14:49:31 +0800 Subject: [PATCH] add AsExtra in data_norm op (#35420) * add AsExtra in data_norm op * pass data_layout from python to data_norm op * fix data_layout in data_norm op Co-authored-by: root --- paddle/fluid/operators/data_norm_op.cc | 3 ++- python/paddle/fluid/layers/nn.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/data_norm_op.cc b/paddle/fluid/operators/data_norm_op.cc index 91e8c04a3d..a89d2949a2 100644 --- a/paddle/fluid/operators/data_norm_op.cc +++ b/paddle/fluid/operators/data_norm_op.cc @@ -232,7 +232,8 @@ class DataNormOpMaker : public framework::OpProtoAndCheckerMaker { .SetDefault(false); AddAttr("use_mkldnn", "(bool, default false) Only used in mkldnn kernel") - .SetDefault(false); + .SetDefault(false) + .AsExtra(); AddInput("X", "The input tensor"); AddInput("BatchSize", "BatchSize is a 1-dimensional tensor of size C " diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 4216384b6f..87b7b28f90 100755 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -3398,6 +3398,7 @@ def data_norm(input, } attrs = { "epsilon": epsilon, + "data_layout": data_layout, "sync_stats": sync_stats, "summary_decay_rate": summary_decay_rate, } -- GitLab