Skip to content

Commit

Permalink
Remove legacy parameter (#42418)
Browse files Browse the repository at this point in the history
* remove stats_md

* add entry to authors.md
  • Loading branch information
Silv3S committed May 5, 2022
1 parent 28375ca commit 5a9d2d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
16 changes: 4 additions & 12 deletions paddle/fluid/operators/mkldnn/layer_norm_mkldnn_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@ class LayerNormMKLDNNHandler : public platform::MKLDNNHandlerNoCachingT<
const dnnl::engine engine, platform::Place cpu_place)
: platform::MKLDNNHandlerNoCachingT<T, dnnl::layer_normalization_forward>(
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<float>(),
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<dnnl::memory> AcquireScaleShiftMemory(const Tensor* scale,
Expand Down

0 comments on commit 5a9d2d2

Please sign in to comment.