From 5a9d2d21841fb659844a7f7af886c7e18bf9ce3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Siwek?= Date: Thu, 5 May 2022 08:56:13 +0200 Subject: [PATCH] Remove legacy parameter (#42418) * remove stats_md * add entry to authors.md --- AUTHORS.md | 1 + .../operators/mkldnn/layer_norm_mkldnn_op.cc | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index e5481d83de..a8ea5c46e9 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -57,6 +57,7 @@ | reyoung | Yang Yu | | [Sand3r-](https://raw.githubusercontent.com/jczaja/Paddle/paddle-poland-team/doc/images/paddle_poland_team.jpg)| Michal Gallus | | [sfraczek](https://raw.githubusercontent.com/jakpiase/Paddle/new_paddle_intel_authors/img/img.jpg)| Sylwester Fraczek | +| Silv3S | Slawomir Siwek | | sneaxiy | Jin-Le Zeng | | Superjom | Chun-Wei Yan | | tensor-tang | Jian Tang | diff --git a/paddle/fluid/operators/mkldnn/layer_norm_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/layer_norm_mkldnn_op.cc index 8f98a0b9fb..5b499b8985 100644 --- a/paddle/fluid/operators/mkldnn/layer_norm_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/layer_norm_mkldnn_op.cc @@ -29,18 +29,10 @@ class LayerNormMKLDNNHandler : public platform::MKLDNNHandlerNoCachingT< const dnnl::engine engine, platform::Place cpu_place) : platform::MKLDNNHandlerNoCachingT( engine, cpu_place) { - if (!is_test) { - // TODO(grygielski) Delete forcing stats_md after DNNL 1.2 is introduced - auto stats_md = dnnl::memory::desc( - {begin(dims), end(dims) - 1}, platform::MKLDNNGetDataType(), - platform::GetPlainMKLDNNFormat(dims.size() - 1)); - this->AcquireForwardPrimitiveDescriptor(dnnl::prop_kind::forward_training, - x->mem_desc(), stats_md, epsilon, - flags); - } else { - this->AcquireForwardPrimitiveDescriptor( - dnnl::prop_kind::forward_inference, x->mem_desc(), epsilon, flags); - } + const auto fwd_prop_kind = is_test ? dnnl::prop_kind::forward_inference + : dnnl::prop_kind::forward_training; + this->AcquireForwardPrimitiveDescriptor(fwd_prop_kind, x->mem_desc(), + epsilon, flags); } std::shared_ptr AcquireScaleShiftMemory(const Tensor* scale, -- GitLab