Publishing R3
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / tests / gtests / test_lrn_forward.cpp
1 /*******************************************************************************
2 * Copyright 2016-2018 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17 #include <cmath>
18
19 #include "mkldnn_test_common.hpp"
20 #include "gtest/gtest.h"
21
22 #include "mkldnn.hpp"
23
24 namespace mkldnn {
25
26 enum {ACROSS=0,WITHIN=1};
27
28 struct test_lrn_desc_t {
29     int mb, c;
30     int h, w;
31     float alpha, beta, k;
32     int local_size;
33     int kind; // 0 ac, 1 wc
34 };
35
36 template <typename data_t>
37 void check_lrn_fwd(const test_lrn_desc_t &ld,
38         const memory::desc &src_d, const memory::desc &dst_d,
39         const memory &src, const memory &dst)
40 {
41     data_t *src_ptr = (data_t *)src.get_data_handle();
42     data_t *dst_ptr = (data_t *)dst.get_data_handle();
43
44     const int C = ld.c;
45     const int H = ld.h;
46     const int W = ld.w;
47     const int size = ld.local_size;
48     const int CSIZE = ld.kind == ACROSS ? size : 1;
49     const int HWSIZE = size + 1 - CSIZE;
50     const int summands = ld.kind == ACROSS ? size : size*size;
51     const int padded_c = src.get_primitive_desc().desc().data.layout_desc.blocking.padding_dims[1];
52
53     auto off = [=](int n, int c, int h, int w)
54     {
55         return ((n * padded_c + c) * ld.h + h) * ld.w + w;
56     };
57
58     auto ker = [=](data_t *d, int n, int oc, int oh, int ow)
59     {
60         data_t sum = 0.0;
61         for (int c = oc; c < oc + CSIZE; ++c) {
62             if (c < (CSIZE - 1) / 2) continue;
63             if (c >= C + (CSIZE - 1) / 2) continue;
64             for (int h = oh; h < oh + HWSIZE; ++h) {
65                 if (h < (HWSIZE - 1) / 2) continue;
66                 if (h >= H + (HWSIZE - 1) / 2) continue;
67                 for (int w = ow; w < ow + HWSIZE; ++w) {
68                     if (w < (HWSIZE - 1) / 2) continue;
69                     if (w >= W + (HWSIZE - 1) / 2) continue;
70                     data_t s = src_ptr[map_index(src_d,off(n, c - (CSIZE - 1) / 2, h - (HWSIZE - 1) / 2, w - (HWSIZE - 1) / 2))];
71                     sum += s * s;
72                 }
73             }
74         }
75         data_t norm_coef = powf(static_cast<float>(ld.k + ld.alpha * sum / summands),
76                                 static_cast<float>(ld.beta));
77         data_t ref_out = src_ptr[map_index(src_d, off(n, oc, oh, ow))]/norm_coef;
78         data_t eps = static_cast<data_t>(1.e-7f*(2*summands+5));
79         data_t out = d[0];
80         data_t norm_max = std::max(fabs(out), fabs(ref_out));
81         if (norm_max < eps) norm_max = 1.;
82         EXPECT_NEAR(out, ref_out, eps*norm_max);
83     };
84
85     const int N = ld.mb;
86 #   pragma omp parallel for collapse(4) schedule(static)
87     for (int n = 0; n < N; ++n) {
88         for (int c = 0; c < padded_c; ++c) {
89             for (int h = 0; h < H; ++h) {
90                 for (int w = 0; w < W; ++w) {
91                     ker(&dst_ptr[map_index(dst_d,off(n, c, h, w))], n, c, h, w);
92                 }
93             }
94         }
95     }
96 }
97
98 struct lrn_fwd_test_params {
99     prop_kind aprop_kind;
100     engine::kind engine_kind;
101     algorithm aalgorithm;
102     memory::format src_format;
103     memory::format dst_format;
104     test_lrn_desc_t test_ld;
105     bool expect_to_fail;
106     mkldnn_status_t expected_status;
107 };
108
109 template <typename data_t>
110 class lrn_forward_test : public ::testing::TestWithParam<lrn_fwd_test_params> {
111     lrn_fwd_test_params p;
112
113 protected:
114     virtual void SetUp() {
115         p = ::testing::TestWithParam<decltype(p)>::GetParam();
116         catch_expected_failures([=](){Test();}, p.expect_to_fail,
117                     p.expected_status);
118     }
119
120     void Test() {
121         ASSERT_TRUE(p.engine_kind == engine::kind::cpu);
122         ASSERT_TRUE(p.aprop_kind == prop_kind::forward_training
123                 || p.aprop_kind == prop_kind::forward_scoring);
124         auto eng = engine(p.engine_kind, 0);
125         memory::data_type data_type = data_traits<data_t>::data_type;
126         ASSERT_EQ(data_type, mkldnn::memory::data_type::f32);
127
128         test_lrn_desc_t ld = p.test_ld;
129         bool with_workspace = p.aprop_kind == prop_kind::forward_training;
130
131         auto l_src_desc = create_md({ ld.mb, ld.c, ld.h, ld.w },
132                 data_type, p.src_format);
133         auto l_dst_desc = create_md({ ld.mb, ld.c, ld.h, ld.w },
134                 data_type, p.dst_format);
135
136         auto l_src = test_memory(l_src_desc, eng);
137         auto l_dst = test_memory(l_dst_desc, eng);
138
139         // Only true for dense format
140         fill_data<data_t>(l_src.get_size() / sizeof(data_t),
141                 (data_t *)l_src.get().get_data_handle());
142         fill_data<data_t>(l_dst.get_size() / sizeof(data_t),
143                 (data_t *)l_dst.get().get_data_handle());
144         check_zero_tail<data_t>(1, l_src.get());
145         check_zero_tail<data_t>(1, l_dst.get());
146
147         auto lrn_desc = lrn_forward::desc(p.aprop_kind, p.aalgorithm,
148                 l_src_desc, ld.local_size, ld.alpha, ld.beta, ld.k);
149         auto lrn_prim_desc = lrn_forward::primitive_desc(lrn_desc, eng);
150
151         // Execute
152         std::vector<primitive> pipeline;
153         auto s = stream(stream::kind::lazy);
154         if (with_workspace) {
155             auto workspace_primitive_desc =
156                 lrn_prim_desc.workspace_primitive_desc();
157             auto workspace_memory = memory(workspace_primitive_desc);
158             auto l = lrn_forward(lrn_prim_desc, l_src.get(),
159                     workspace_memory, l_dst.get());
160             pipeline.push_back(l);
161             s.submit(pipeline).wait();
162         } else {
163             auto l = lrn_forward(lrn_prim_desc, l_src.get(), l_dst.get());
164             pipeline.push_back(l);
165             s.submit(pipeline).wait();
166         }
167         check_zero_tail<data_t>(0, l_dst.get());
168
169         check_lrn_fwd<data_t>(ld, l_src_desc, l_dst_desc, l_src.get(),
170                 l_dst.get());
171     }
172 };
173
174 using lrn_forward_test_float = lrn_forward_test<float>;
175 using lrn_fwd_test_params_float = lrn_fwd_test_params;
176
177 TEST_P(lrn_forward_test_float, TestsLRN)
178 {
179 }
180
181 INSTANTIATE_TEST_CASE_P(TestLRNForward_nChw16c_padded, lrn_forward_test_float,
182         ::testing::Values(
183             lrn_fwd_test_params_float{ prop_kind::forward_training,
184             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
185             memory::format::nChw16c, { 2, 17, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
186             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
187             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
188             memory::format::nChw16c, { 2, 19, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
189             , lrn_fwd_test_params_float{ prop_kind::forward_training,
190             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
191             memory::format::nChw16c, { 2, 26, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
192             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
193             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
194             memory::format::nChw16c, { 2, 12, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
195             ));
196
197 INSTANTIATE_TEST_CASE_P(TestLRNForwardEF, lrn_forward_test_float,
198         ::testing::Values(
199             lrn_fwd_test_params_float{ prop_kind::forward_training,
200             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
201             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
202             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
203             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
204             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
205             , lrn_fwd_test_params_float{ prop_kind::forward_training,
206             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
207             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 3.0f, 5, ACROSS } }
208             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
209             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
210             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 3.0f, 5, ACROSS } }
211             ));
212
213 INSTANTIATE_TEST_CASE_P(TestLRNForward, lrn_forward_test_float,
214         ::testing::Values(
215             lrn_fwd_test_params_float{ prop_kind::forward_training,
216             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
217             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
218             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
219             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
220             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
221             , lrn_fwd_test_params_float{ prop_kind::forward_training,
222             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
223             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 3.0f, 5, ACROSS } }
224             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
225             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
226             memory::format::nchw, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 3.0f, 5, ACROSS } }
227             ));
228
229 INSTANTIATE_TEST_CASE_P(TestLRNForwardNHWC, lrn_forward_test_float,
230         ::testing::Values(
231             lrn_fwd_test_params_float{ prop_kind::forward_training,
232             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
233             memory::format::nhwc, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
234             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
235             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
236             memory::format::nhwc, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
237             , lrn_fwd_test_params_float{ prop_kind::forward_training,
238             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
239             memory::format::nhwc, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 4.85f, 5, ACROSS } }
240             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
241             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
242             memory::format::nhwc, { 2, 10, 4, 4, 1.0e-4f, 0.75f, 4.85f, 5, ACROSS } }
243             ));
244
245 INSTANTIATE_TEST_CASE_P(TestLRNForward_nChw8c, lrn_forward_test_float,
246         ::testing::Values(
247             lrn_fwd_test_params_float{ prop_kind::forward_training,
248             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
249             memory::format::nChw8c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
250             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
251             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
252             memory::format::nChw8c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
253             , lrn_fwd_test_params_float{ prop_kind::forward_training,
254             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
255             memory::format::nChw8c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
256             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
257             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
258             memory::format::nChw8c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
259             ));
260
261 INSTANTIATE_TEST_CASE_P(TestLRNForward_nChw16c, lrn_forward_test_float,
262         ::testing::Values(
263             lrn_fwd_test_params_float{ prop_kind::forward_training,
264             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
265             memory::format::nChw16c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
266             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
267             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
268             memory::format::nChw16c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
269             , lrn_fwd_test_params_float{ prop_kind::forward_training,
270             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
271             memory::format::nChw16c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
272             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
273             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
274             memory::format::nChw16c, { 2, 16, 4, 4, 1.0e-4f, 0.75f, 5.7f, 5, ACROSS } }
275             ));
276
277 INSTANTIATE_TEST_CASE_P(
278         TestLRNAlexnetForwardNCHW, lrn_forward_test_float,
279         ::testing::Values(
280             lrn_fwd_test_params_float{ prop_kind::forward_training,
281             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
282             memory::format::nchw, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
283             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
284             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
285             memory::format::nchw, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
286             , lrn_fwd_test_params_float{ prop_kind::forward_training,
287             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
288             memory::format::nchw, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
289             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
290             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
291             memory::format::nchw, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
292             ));
293
294 INSTANTIATE_TEST_CASE_P(
295         TestLRNAlexnetForwardNHWC, lrn_forward_test_float,
296         ::testing::Values(
297                 lrn_fwd_test_params_float{ prop_kind::forward_training,
298                 engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
299                 memory::format::nhwc, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
300                 lrn_fwd_test_params_float{ prop_kind::forward_scoring,
301                 engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
302                 memory::format::nhwc, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
303                 lrn_fwd_test_params_float{ prop_kind::forward_training,
304                 engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
305                 memory::format::nhwc, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
306                 lrn_fwd_test_params_float{ prop_kind::forward_scoring,
307                 engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nhwc,
308                 memory::format::nhwc, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
309             ));
310
311 INSTANTIATE_TEST_CASE_P(
312         TestLRNAlexnetForward_nChw8c, lrn_forward_test_float,
313         ::testing::Values(
314             lrn_fwd_test_params_float{ prop_kind::forward_training,
315             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
316             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
317             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
318             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
319             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
320             lrn_fwd_test_params_float{ prop_kind::forward_training,
321             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
322             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
323             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
324             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
325             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
326             ));
327
328 INSTANTIATE_TEST_CASE_P(
329         TestLRNAlexnetForward_nChw16c, lrn_forward_test_float,
330         ::testing::Values(
331             lrn_fwd_test_params_float{ prop_kind::forward_training,
332             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
333             memory::format::nChw16c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
334             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
335             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
336             memory::format::nChw16c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
337             lrn_fwd_test_params_float{ prop_kind::forward_training,
338             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
339             memory::format::nChw16c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
340             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
341             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
342             memory::format::nChw16c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
343             ));
344
345 INSTANTIATE_TEST_CASE_P(
346         TestLRNGoogleNetV1ForwardNCHW, lrn_forward_test_float,
347         ::testing::Values(
348             lrn_fwd_test_params_float{ prop_kind::forward_training,
349             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
350             memory::format::nchw, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
351             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
352             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
353             memory::format::nchw, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
354             lrn_fwd_test_params_float{ prop_kind::forward_training,
355             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
356             memory::format::nchw, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
357             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
358             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nchw,
359             memory::format::nchw, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
360             ));
361
362 INSTANTIATE_TEST_CASE_P(
363         TestLRNGoogleNetV1Forward_nChw8c, lrn_forward_test_float,
364         ::testing::Values(
365             lrn_fwd_test_params_float{ prop_kind::forward_training,
366             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
367             memory::format::nChw8c, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
368             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
369             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
370             memory::format::nChw8c, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
371             lrn_fwd_test_params_float{ prop_kind::forward_training,
372             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
373             memory::format::nChw8c, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
374             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
375             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw8c,
376             memory::format::nChw8c, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
377             ));
378
379 INSTANTIATE_TEST_CASE_P(
380         TestLRNGoogleNetV1Forward_nChw16c, lrn_forward_test_float,
381         ::testing::Values(
382             lrn_fwd_test_params_float{ prop_kind::forward_training,
383             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
384             memory::format::nChw16c, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
385             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
386             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
387             memory::format::nChw16c, { 2, 64, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
388             lrn_fwd_test_params_float{ prop_kind::forward_training,
389             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
390             memory::format::nChw16c, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } },
391             lrn_fwd_test_params_float{ prop_kind::forward_scoring,
392             engine::kind::cpu, algorithm::lrn_across_channels, memory::format::nChw16c,
393             memory::format::nChw16c, { 2, 192, 56, 56, 1.0e-4f, 0.75f, 1.0f, 5, ACROSS } }
394             ));
395
396 INSTANTIATE_TEST_CASE_P(
397         TestLRNRCNNForwardBlocked, lrn_forward_test_float,
398         ::testing::Values(
399             lrn_fwd_test_params_float{ prop_kind::forward_training,
400             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
401             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 3, WITHIN } }
402             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
403             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
404             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 3, WITHIN } }
405             , lrn_fwd_test_params_float{ prop_kind::forward_training,
406             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
407             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 3, WITHIN } }
408             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
409             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
410             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 3, WITHIN } }
411             , lrn_fwd_test_params_float{ prop_kind::forward_training,
412             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
413             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, WITHIN } }
414             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
415             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
416             memory::format::nChw8c, { 2, 96, 55, 55, 1.0e-4f, 0.75f, 1.0f, 5, WITHIN } }
417             , lrn_fwd_test_params_float{ prop_kind::forward_training,
418             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
419             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, WITHIN } }
420             , lrn_fwd_test_params_float{ prop_kind::forward_scoring,
421             engine::kind::cpu, algorithm::lrn_within_channel, memory::format::nChw8c,
422             memory::format::nChw8c, { 2, 256, 27, 27, 1.0e-4f, 0.75f, 1.0f, 5, WITHIN } }
423             ));
424
425 }