1 // Copyright (c) Facebook, Inc. and its affiliates.
2 // All rights reserved.
3 //
4 // Copyright 2019 Google LLC
5 //
6 // This source code is licensed under the BSD-style license found in the
7 // LICENSE file in the root directory of this source tree.
8
9 #include <gtest/gtest.h>
10
11 #include "convolution-operator-tester.h"
12
13
14 TEST(CONVOLUTION_NHWC_Q8, 1x1) {
15 ConvolutionOperatorTester()
16 .input_size(27, 29)
17 .kernel_size(1, 1)
18 .group_input_channels(23)
19 .group_output_channels(19)
20 .iterations(3)
21 .TestNHWCxQ8();
22 }
23
24 TEST(CONVOLUTION_NHWC_Q8, 1x1_with_qmin) {
25 ConvolutionOperatorTester()
26 .input_size(27, 29)
27 .kernel_size(1, 1)
28 .group_input_channels(23)
29 .group_output_channels(19)
30 .qmin(128)
31 .iterations(3)
32 .TestNHWCxQ8();
33 }
34
35 TEST(CONVOLUTION_NHWC_Q8, 1x1_with_qmax) {
36 ConvolutionOperatorTester()
37 .input_size(27, 29)
38 .kernel_size(1, 1)
39 .group_input_channels(23)
40 .group_output_channels(19)
41 .qmax(128)
42 .iterations(3)
43 .TestNHWCxQ8();
44 }
45
46 TEST(CONVOLUTION_NHWC_Q8, 1x1_with_input_stride) {
47 ConvolutionOperatorTester()
48 .input_size(27, 29)
49 .kernel_size(1, 1)
50 .input_pixel_stride(28)
51 .group_input_channels(23)
52 .group_output_channels(19)
53 .iterations(3)
54 .TestNHWCxQ8();
55 }
56
57 TEST(CONVOLUTION_NHWC_Q8, 1x1_with_output_stride) {
58 ConvolutionOperatorTester()
59 .input_size(27, 29)
60 .kernel_size(1, 1)
61 .output_pixel_stride(29)
62 .group_input_channels(23)
63 .group_output_channels(19)
64 .iterations(3)
65 .TestNHWCxQ8();
66 }
67
68 TEST(CONVOLUTION_NHWC_Q8, 1x1_without_bias) {
69 ConvolutionOperatorTester()
70 .has_bias(false)
71 .input_size(13, 14)
72 .kernel_size(1, 1)
73 .group_input_channels(23)
74 .group_output_channels(19)
75 .iterations(3)
76 .TestNHWCxQ8();
77 }
78
79 TEST(CONVOLUTION_NHWC_Q8, 1x1_with_batch) {
80 ConvolutionOperatorTester()
81 .batch_size(3)
82 .input_size(13, 14)
83 .kernel_size(1, 1)
84 .group_input_channels(23)
85 .group_output_channels(19)
86 .iterations(3)
87 .TestNHWCxQ8();
88 }
89
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1)90 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1) {
91 ConvolutionOperatorTester()
92 .input_size(24, 25)
93 .kernel_size(1, 1)
94 .groups(2)
95 .group_input_channels(17)
96 .group_output_channels(19)
97 .iterations(3)
98 .TestNHWCxQ8();
99 }
100
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_with_qmin)101 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_with_qmin) {
102 ConvolutionOperatorTester()
103 .input_size(24, 25)
104 .kernel_size(1, 1)
105 .groups(2)
106 .group_input_channels(17)
107 .group_output_channels(19)
108 .qmin(128)
109 .iterations(3)
110 .TestNHWCxQ8();
111 }
112
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_with_qmax)113 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_with_qmax) {
114 ConvolutionOperatorTester()
115 .input_size(24, 25)
116 .kernel_size(1, 1)
117 .groups(2)
118 .group_input_channels(17)
119 .group_output_channels(19)
120 .qmax(128)
121 .iterations(3)
122 .TestNHWCxQ8();
123 }
124
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_with_input_stride)125 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_with_input_stride) {
126 ConvolutionOperatorTester()
127 .input_size(24, 25)
128 .kernel_size(1, 1)
129 .groups(2)
130 .input_pixel_stride(37)
131 .group_input_channels(17)
132 .group_output_channels(19)
133 .iterations(3)
134 .TestNHWCxQ8();
135 }
136
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_with_output_stride)137 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_with_output_stride) {
138 ConvolutionOperatorTester()
139 .input_size(24, 25)
140 .kernel_size(1, 1)
141 .groups(2)
142 .output_pixel_stride(41)
143 .group_input_channels(17)
144 .group_output_channels(19)
145 .iterations(3)
146 .TestNHWCxQ8();
147 }
148
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_without_bias)149 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_without_bias) {
150 ConvolutionOperatorTester()
151 .has_bias(false)
152 .input_size(24, 25)
153 .kernel_size(1, 1)
154 .groups(2)
155 .group_input_channels(17)
156 .group_output_channels(19)
157 .iterations(3)
158 .TestNHWCxQ8();
159 }
160
TEST(CONVOLUTION_NHWC_Q8,grouped_1x1_with_batch)161 TEST(CONVOLUTION_NHWC_Q8, grouped_1x1_with_batch) {
162 ConvolutionOperatorTester()
163 .batch_size(3)
164 .input_size(24, 25)
165 .kernel_size(1, 1)
166 .groups(2)
167 .group_input_channels(17)
168 .group_output_channels(19)
169 .iterations(3)
170 .TestNHWCxQ8();
171 }
172
173 TEST(CONVOLUTION_NHWC_Q8, 1x3) {
174 ConvolutionOperatorTester()
175 .input_size(20, 19)
176 .padding_width(1)
177 .kernel_size(1, 3)
178 .group_input_channels(17)
179 .group_output_channels(15)
180 .iterations(3)
181 .TestNHWCxQ8();
182 }
183
TEST(CONVOLUTION_NHWC_Q8,grouped_1x3)184 TEST(CONVOLUTION_NHWC_Q8, grouped_1x3) {
185 ConvolutionOperatorTester()
186 .input_size(20, 19)
187 .padding_width(1)
188 .kernel_size(1, 3)
189 .groups(2)
190 .group_input_channels(17)
191 .group_output_channels(15)
192 .iterations(3)
193 .TestNHWCxQ8();
194 }
195
196 TEST(CONVOLUTION_NHWC_Q8, 3x1) {
197 ConvolutionOperatorTester()
198 .input_size(19, 20)
199 .padding_height(1)
200 .kernel_size(3, 1)
201 .group_input_channels(17)
202 .group_output_channels(15)
203 .iterations(3)
204 .TestNHWCxQ8();
205 }
206
TEST(CONVOLUTION_NHWC_Q8,grouped_3x1)207 TEST(CONVOLUTION_NHWC_Q8, grouped_3x1) {
208 ConvolutionOperatorTester()
209 .input_size(19, 20)
210 .padding_height(1)
211 .kernel_size(3, 1)
212 .groups(2)
213 .group_input_channels(17)
214 .group_output_channels(15)
215 .iterations(3)
216 .TestNHWCxQ8();
217 }
218
219 TEST(CONVOLUTION_NHWC_Q8, 3x3) {
220 ConvolutionOperatorTester()
221 .input_size(13, 12)
222 .padding(1)
223 .kernel_size(3, 3)
224 .group_input_channels(15)
225 .group_output_channels(17)
226 .iterations(3)
227 .TestNHWCxQ8();
228 }
229
230 TEST(CONVOLUTION_NHWC_Q8, 3x3_without_padding) {
231 ConvolutionOperatorTester()
232 .input_size(13, 12)
233 .kernel_size(3, 3)
234 .group_input_channels(15)
235 .group_output_channels(17)
236 .iterations(3)
237 .TestNHWCxQ8();
238 }
239
240 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_left_padding) {
241 ConvolutionOperatorTester()
242 .input_size(13, 12)
243 .padding_left(1)
244 .kernel_size(3, 3)
245 .group_input_channels(15)
246 .group_output_channels(17)
247 .iterations(3)
248 .TestNHWCxQ8();
249 }
250
251 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_right_padding) {
252 ConvolutionOperatorTester()
253 .input_size(13, 12)
254 .padding_right(1)
255 .kernel_size(3, 3)
256 .group_input_channels(15)
257 .group_output_channels(17)
258 .iterations(3)
259 .TestNHWCxQ8();
260 }
261
262 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_top_padding) {
263 ConvolutionOperatorTester()
264 .input_size(13, 12)
265 .padding_top(1)
266 .kernel_size(3, 3)
267 .group_input_channels(15)
268 .group_output_channels(17)
269 .iterations(3)
270 .TestNHWCxQ8();
271 }
272
273 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_bottom_padding) {
274 ConvolutionOperatorTester()
275 .input_size(13, 12)
276 .padding_bottom(1)
277 .kernel_size(3, 3)
278 .group_input_channels(15)
279 .group_output_channels(17)
280 .iterations(3)
281 .TestNHWCxQ8();
282 }
283
284 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_input_stride) {
285 ConvolutionOperatorTester()
286 .input_size(13, 12)
287 .padding(1)
288 .kernel_size(3, 3)
289 .input_pixel_stride(22)
290 .group_input_channels(15)
291 .group_output_channels(17)
292 .iterations(3)
293 .TestNHWCxQ8();
294 }
295
296 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_output_stride) {
297 ConvolutionOperatorTester()
298 .input_size(13, 12)
299 .padding(1)
300 .kernel_size(3, 3)
301 .output_pixel_stride(23)
302 .group_input_channels(15)
303 .group_output_channels(17)
304 .iterations(3)
305 .TestNHWCxQ8();
306 }
307
308 TEST(CONVOLUTION_NHWC_Q8, 3x3_without_bias) {
309 ConvolutionOperatorTester()
310 .has_bias(false)
311 .input_size(10, 9)
312 .padding(1)
313 .kernel_size(3, 3)
314 .group_input_channels(15)
315 .group_output_channels(17)
316 .iterations(3)
317 .TestNHWCxQ8();
318 }
319
320 TEST(CONVOLUTION_NHWC_Q8, 3x3_with_batch) {
321 ConvolutionOperatorTester()
322 .batch_size(3)
323 .input_size(10, 9)
324 .padding(1)
325 .kernel_size(3, 3)
326 .group_input_channels(15)
327 .group_output_channels(17)
328 .iterations(3)
329 .TestNHWCxQ8();
330 }
331
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3)332 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3) {
333 ConvolutionOperatorTester()
334 .input_size(10, 11)
335 .padding(1)
336 .kernel_size(3, 3)
337 .groups(2)
338 .group_input_channels(14)
339 .group_output_channels(13)
340 .iterations(3)
341 .TestNHWCxQ8();
342 }
343
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_without_padding)344 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_without_padding) {
345 ConvolutionOperatorTester()
346 .input_size(13, 12)
347 .kernel_size(3, 3)
348 .group_input_channels(15)
349 .group_output_channels(17)
350 .iterations(3)
351 .TestNHWCxQ8();
352 }
353
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_left_padding)354 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_left_padding) {
355 ConvolutionOperatorTester()
356 .input_size(10, 11)
357 .padding_left(1)
358 .kernel_size(3, 3)
359 .groups(2)
360 .group_input_channels(14)
361 .group_output_channels(13)
362 .iterations(3)
363 .TestNHWCxQ8();
364 }
365
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_right_padding)366 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_right_padding) {
367 ConvolutionOperatorTester()
368 .input_size(10, 11)
369 .padding_right(1)
370 .kernel_size(3, 3)
371 .groups(2)
372 .group_input_channels(14)
373 .group_output_channels(13)
374 .iterations(3)
375 .TestNHWCxQ8();
376 }
377
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_top_padding)378 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_top_padding) {
379 ConvolutionOperatorTester()
380 .input_size(10, 11)
381 .padding_top(1)
382 .kernel_size(3, 3)
383 .groups(2)
384 .group_input_channels(14)
385 .group_output_channels(13)
386 .iterations(3)
387 .TestNHWCxQ8();
388 }
389
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_bottom_padding)390 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_bottom_padding) {
391 ConvolutionOperatorTester()
392 .input_size(10, 11)
393 .padding_bottom(1)
394 .kernel_size(3, 3)
395 .groups(2)
396 .group_input_channels(14)
397 .group_output_channels(13)
398 .iterations(3)
399 .TestNHWCxQ8();
400 }
401
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_input_stride)402 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_input_stride) {
403 ConvolutionOperatorTester()
404 .input_size(10, 11)
405 .padding(1)
406 .kernel_size(3, 3)
407 .groups(2)
408 .input_pixel_stride(29)
409 .group_input_channels(14)
410 .group_output_channels(13)
411 .iterations(3)
412 .TestNHWCxQ8();
413 }
414
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_output_stride)415 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_output_stride) {
416 ConvolutionOperatorTester()
417 .input_size(10, 11)
418 .padding(1)
419 .kernel_size(3, 3)
420 .groups(2)
421 .output_pixel_stride(31)
422 .group_input_channels(14)
423 .group_output_channels(13)
424 .iterations(3)
425 .TestNHWCxQ8();
426 }
427
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_without_bias)428 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_without_bias) {
429 ConvolutionOperatorTester()
430 .has_bias(false)
431 .input_size(10, 11)
432 .padding(1)
433 .kernel_size(3, 3)
434 .groups(2)
435 .group_input_channels(14)
436 .group_output_channels(13)
437 .iterations(3)
438 .TestNHWCxQ8();
439 }
440
TEST(CONVOLUTION_NHWC_Q8,grouped_3x3_with_batch)441 TEST(CONVOLUTION_NHWC_Q8, grouped_3x3_with_batch) {
442 ConvolutionOperatorTester()
443 .batch_size(3)
444 .input_size(10, 11)
445 .padding(1)
446 .kernel_size(3, 3)
447 .groups(2)
448 .group_input_channels(14)
449 .group_output_channels(13)
450 .iterations(3)
451 .TestNHWCxQ8();
452 }
453
454 TEST(CONVOLUTION_NHWC_Q8, 3x3s2) {
455 ConvolutionOperatorTester()
456 .input_size(14, 13)
457 .padding(1)
458 .kernel_size(3, 3)
459 .subsampling(2)
460 .group_input_channels(27)
461 .group_output_channels(19)
462 .iterations(3)
463 .TestNHWCxQ8();
464 }
465
466 TEST(CONVOLUTION_NHWC_Q8, 3x3s2_with_tf_same_padding) {
467 for (size_t input_height = 13; input_height <= 14; input_height++) {
468 for (size_t input_width = 13; input_width <= 14; input_width++) {
469 ConvolutionOperatorTester()
470 .input_size(input_height, input_width)
471 .padding_tf_same(true)
472 .kernel_size(3, 3)
473 .subsampling(2)
474 .group_input_channels(27)
475 .group_output_channels(19)
476 .iterations(3)
477 .TestNHWCxQ8();
478 }
479 }
480 }
481
482 TEST(CONVOLUTION_NHWC_Q8, 3x3s1x2) {
483 ConvolutionOperatorTester()
484 .input_size(14, 13)
485 .padding(1)
486 .kernel_size(3, 3)
487 .subsampling(1, 2)
488 .group_input_channels(27)
489 .group_output_channels(19)
490 .iterations(3)
491 .TestNHWCxQ8();
492 }
493
494 TEST(CONVOLUTION_NHWC_Q8, 3x3s1x2_with_tf_same_padding) {
495 for (size_t input_height = 13; input_height <= 14; input_height++) {
496 for (size_t input_width = 13; input_width <= 14; input_width++) {
497 ConvolutionOperatorTester()
498 .input_size(input_height, input_width)
499 .padding_tf_same(true)
500 .kernel_size(3, 3)
501 .subsampling(1, 2)
502 .group_input_channels(27)
503 .group_output_channels(19)
504 .iterations(3)
505 .TestNHWCxQ8();
506 }
507 }
508 }
509
510 TEST(CONVOLUTION_NHWC_Q8, 3x3s2x1) {
511 ConvolutionOperatorTester()
512 .input_size(14, 13)
513 .padding(1)
514 .kernel_size(3, 3)
515 .subsampling(2, 1)
516 .group_input_channels(27)
517 .group_output_channels(19)
518 .iterations(3)
519 .TestNHWCxQ8();
520 }
521
522 TEST(CONVOLUTION_NHWC_Q8, 3x3s2x1_with_tf_same_padding) {
523 for (size_t input_height = 13; input_height <= 14; input_height++) {
524 for (size_t input_width = 13; input_width <= 14; input_width++) {
525 ConvolutionOperatorTester()
526 .input_size(input_height, input_width)
527 .padding_tf_same(true)
528 .kernel_size(3, 3)
529 .subsampling(2, 1)
530 .group_input_channels(27)
531 .group_output_channels(19)
532 .iterations(3)
533 .TestNHWCxQ8();
534 }
535 }
536 }
537
538 TEST(CONVOLUTION_NHWC_Q8, 3x3d2) {
539 ConvolutionOperatorTester()
540 .input_size(14, 13)
541 .padding(2)
542 .kernel_size(3, 3)
543 .dilation(2)
544 .group_input_channels(27)
545 .group_output_channels(19)
546 .iterations(3)
547 .TestNHWCxQ8();
548 }
549
550 TEST(CONVOLUTION_NHWC_Q8, 3x3d1x2) {
551 ConvolutionOperatorTester()
552 .input_size(14, 13)
553 .padding(1, 2)
554 .kernel_size(3, 3)
555 .dilation(1, 2)
556 .group_input_channels(27)
557 .group_output_channels(19)
558 .iterations(3)
559 .TestNHWCxQ8();
560 }
561
562 TEST(CONVOLUTION_NHWC_Q8, 3x3d2x1) {
563 ConvolutionOperatorTester()
564 .input_size(14, 13)
565 .padding(2, 1)
566 .kernel_size(3, 3)
567 .dilation(2, 1)
568 .group_input_channels(27)
569 .group_output_channels(19)
570 .iterations(3)
571 .TestNHWCxQ8();
572 }
573
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3)574 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3) {
575 ConvolutionOperatorTester()
576 .input_size(15, 14)
577 .padding(1, 1)
578 .kernel_size(3, 3)
579 .groups(27)
580 .iterations(3)
581 .TestNHWCxQ8();
582 }
583
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3_without_bias)584 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3_without_bias) {
585 ConvolutionOperatorTester()
586 .has_bias(false)
587 .input_size(15, 14)
588 .padding(1, 1)
589 .kernel_size(3, 3)
590 .groups(27)
591 .iterations(3)
592 .TestNHWCxQ8();
593 }
594
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s2)595 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s2) {
596 ConvolutionOperatorTester()
597 .input_size(15, 14)
598 .padding(1, 1)
599 .kernel_size(3, 3)
600 .subsampling(2)
601 .groups(27)
602 .iterations(3)
603 .TestNHWCxQ8();
604 }
605
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s2_with_tf_same_padding)606 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s2_with_tf_same_padding) {
607 for (size_t input_height = 14; input_height <= 15; input_height++) {
608 for (size_t input_width = 14; input_width <= 15; input_width++) {
609 ConvolutionOperatorTester()
610 .input_size(input_height, input_width)
611 .padding_tf_same(true)
612 .kernel_size(3, 3)
613 .subsampling(2)
614 .groups(27)
615 .iterations(3)
616 .TestNHWCxQ8();
617 }
618 }
619 }
620
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s1x2)621 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s1x2) {
622 ConvolutionOperatorTester()
623 .input_size(15, 14)
624 .padding(1, 1)
625 .kernel_size(3, 3)
626 .subsampling(1, 2)
627 .groups(27)
628 .iterations(3)
629 .TestNHWCxQ8();
630 }
631
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s1x2_with_tf_same_padding)632 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s1x2_with_tf_same_padding) {
633 for (size_t input_height = 14; input_height <= 15; input_height++) {
634 for (size_t input_width = 14; input_width <= 15; input_width++) {
635 ConvolutionOperatorTester()
636 .input_size(input_height, input_width)
637 .padding_tf_same(true)
638 .kernel_size(3, 3)
639 .subsampling(1, 2)
640 .groups(27)
641 .iterations(3)
642 .TestNHWCxQ8();
643 }
644 }
645 }
646
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s2x1)647 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s2x1) {
648 ConvolutionOperatorTester()
649 .input_size(15, 14)
650 .padding(1, 1)
651 .kernel_size(3, 3)
652 .subsampling(2, 1)
653 .groups(27)
654 .iterations(3)
655 .TestNHWCxQ8();
656 }
657
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3s2x1_with_tf_same_padding)658 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3s2x1_with_tf_same_padding) {
659 for (size_t input_height = 14; input_height <= 15; input_height++) {
660 for (size_t input_width = 14; input_width <= 15; input_width++) {
661 ConvolutionOperatorTester()
662 .input_size(input_height, input_width)
663 .padding_tf_same(true)
664 .kernel_size(3, 3)
665 .subsampling(2, 1)
666 .groups(27)
667 .iterations(3)
668 .TestNHWCxQ8();
669 }
670 }
671 }
672
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3d2)673 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3d2) {
674 ConvolutionOperatorTester()
675 .input_size(15, 14)
676 .padding(1, 1)
677 .kernel_size(3, 3)
678 .dilation(2)
679 .groups(27)
680 .iterations(3)
681 .TestNHWCxQ8();
682 }
683
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3d1x2)684 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3d1x2) {
685 ConvolutionOperatorTester()
686 .input_size(15, 14)
687 .padding(1, 1)
688 .kernel_size(3, 3)
689 .dilation(1, 2)
690 .groups(27)
691 .iterations(3)
692 .TestNHWCxQ8();
693 }
694
TEST(CONVOLUTION_NHWC_Q8,depthwise_3x3d2x1)695 TEST(CONVOLUTION_NHWC_Q8, depthwise_3x3d2x1) {
696 ConvolutionOperatorTester()
697 .input_size(15, 14)
698 .padding(1, 1)
699 .kernel_size(3, 3)
700 .dilation(2, 1)
701 .groups(27)
702 .iterations(3)
703 .TestNHWCxQ8();
704 }
705
706 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 1x1) {
707 ConvolutionOperatorTester()
708 .depthwise_layout(true)
709 .input_size(15, 14)
710 .kernel_size(1, 1)
711 .groups(24)
712 .iterations(3)
713 .TestNHWCxQ8();
714 }
715
716 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 1x1_with_depth_multiplier) {
717 ConvolutionOperatorTester()
718 .depthwise_layout(true)
719 .input_size(15, 14)
720 .kernel_size(1, 1)
721 .groups(24)
722 .group_output_channels(3)
723 .iterations(3)
724 .TestNHWCxQ8();
725 }
726
727 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 1x1_without_bias) {
728 ConvolutionOperatorTester()
729 .depthwise_layout(true)
730 .has_bias(false)
731 .input_size(15, 14)
732 .kernel_size(1, 1)
733 .groups(24)
734 .iterations(3)
735 .TestNHWCxQ8();
736 }
737
738 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 3x3) {
739 ConvolutionOperatorTester()
740 .depthwise_layout(true)
741 .input_size(15, 14)
742 .padding(1, 1)
743 .kernel_size(3, 3)
744 .groups(24)
745 .iterations(3)
746 .TestNHWCxQ8();
747 }
748
749 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 3x3_with_depth_multiplier) {
750 ConvolutionOperatorTester()
751 .depthwise_layout(true)
752 .input_size(15, 14)
753 .padding(1, 1)
754 .kernel_size(3, 3)
755 .groups(24)
756 .group_output_channels(3)
757 .iterations(3)
758 .TestNHWCxQ8();
759 }
760
761 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 3x3_without_bias) {
762 ConvolutionOperatorTester()
763 .depthwise_layout(true)
764 .has_bias(false)
765 .input_size(15, 14)
766 .padding(1, 1)
767 .kernel_size(3, 3)
768 .groups(24)
769 .iterations(3)
770 .TestNHWCxQ8();
771 }
772
773 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 3x3s2_with_tf_same_padding) {
774 for (size_t input_height = 14; input_height <= 15; input_height++) {
775 for (size_t input_width = 14; input_width <= 15; input_width++) {
776 ConvolutionOperatorTester()
777 .depthwise_layout(true)
778 .input_size(input_height, input_width)
779 .padding_tf_same(true)
780 .kernel_size(3, 3)
781 .groups(24)
782 .iterations(3)
783 .TestNHWCxQ8();
784 }
785 }
786 }
787
788 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 5x5) {
789 ConvolutionOperatorTester()
790 .depthwise_layout(true)
791 .input_size(15, 14)
792 .padding(2, 2)
793 .kernel_size(5, 5)
794 .groups(24)
795 .iterations(3)
796 .TestNHWCxQ8();
797 }
798
799 TEST(DEPTHWISE_CONVOLUTION_NHWC_Q8, 5x5_without_bias) {
800 ConvolutionOperatorTester()
801 .depthwise_layout(true)
802 .has_bias(false)
803 .input_size(15, 14)
804 .padding(2, 2)
805 .kernel_size(5, 5)
806 .groups(24)
807 .iterations(3)
808 .TestNHWCxQ8();
809 }
810
TEST(CONVOLUTION_NHWC_Q8,setup_changing_input_buffer)811 TEST(CONVOLUTION_NHWC_Q8, setup_changing_input_buffer) {
812 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
813 ConvolutionOperatorTester()
814 .batch_size(3)
815 .input_height(8)
816 .input_width(8)
817 .kernel_height(5)
818 .kernel_width(3)
819 .group_input_channels(15)
820 .group_output_channels(17)
821 .TestSetupNHWCxQ8();
822 }
823
TEST(CONVOLUTION_NHWC_Q8,setup_changing_input_buffer_grouped)824 TEST(CONVOLUTION_NHWC_Q8, setup_changing_input_buffer_grouped) {
825 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
826 ConvolutionOperatorTester()
827 .batch_size(3)
828 .input_height(8)
829 .input_width(8)
830 .kernel_height(5)
831 .kernel_width(3)
832 .groups(2)
833 .group_input_channels(15)
834 .group_output_channels(17)
835 .TestSetupNHWCxQ8();
836 }
837
TEST(CONVOLUTION_NHWC_Q8,setup_changing_input_buffer_depthwise)838 TEST(CONVOLUTION_NHWC_Q8, setup_changing_input_buffer_depthwise) {
839 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
840 ConvolutionOperatorTester()
841 .batch_size(3)
842 .input_height(8)
843 .input_width(8)
844 .kernel_height(3)
845 .kernel_width(3)
846 .groups(19)
847 .group_input_channels(1)
848 .group_output_channels(1)
849 .TestSetupNHWCxQ8();
850 }
851
TEST(CONVOLUTION_NHWC_Q8,setup_increasing_batch)852 TEST(CONVOLUTION_NHWC_Q8, setup_increasing_batch) {
853 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
854 ConvolutionOperatorTester()
855 .batch_size(3)
856 .next_batch_size(5)
857 .input_height(8)
858 .input_width(8)
859 .kernel_height(5)
860 .kernel_width(3)
861 .group_input_channels(15)
862 .group_output_channels(17)
863 .TestSetupNHWCxQ8();
864 }
865
TEST(CONVOLUTION_NHWC_Q8,setup_increasing_batch_grouped)866 TEST(CONVOLUTION_NHWC_Q8, setup_increasing_batch_grouped) {
867 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
868 ConvolutionOperatorTester()
869 .batch_size(3)
870 .next_batch_size(5)
871 .input_height(8)
872 .input_width(8)
873 .kernel_height(5)
874 .kernel_width(3)
875 .groups(2)
876 .group_input_channels(15)
877 .group_output_channels(17)
878 .TestSetupNHWCxQ8();
879 }
880
TEST(CONVOLUTION_NHWC_Q8,setup_increasing_batch_depthwise)881 TEST(CONVOLUTION_NHWC_Q8, setup_increasing_batch_depthwise) {
882 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
883 ConvolutionOperatorTester()
884 .batch_size(3)
885 .next_batch_size(5)
886 .input_height(8)
887 .input_width(8)
888 .kernel_height(3)
889 .kernel_width(3)
890 .groups(19)
891 .group_input_channels(1)
892 .group_output_channels(1)
893 .TestSetupNHWCxQ8();
894 }
895
TEST(CONVOLUTION_NHWC_Q8,setup_decreasing_batch)896 TEST(CONVOLUTION_NHWC_Q8, setup_decreasing_batch) {
897 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
898 ConvolutionOperatorTester()
899 .batch_size(5)
900 .next_batch_size(3)
901 .input_height(8)
902 .input_width(8)
903 .kernel_height(5)
904 .kernel_width(3)
905 .group_input_channels(15)
906 .group_output_channels(17)
907 .TestSetupNHWCxQ8();
908 }
909
TEST(CONVOLUTION_NHWC_Q8,setup_decreasing_batch_grouped)910 TEST(CONVOLUTION_NHWC_Q8, setup_decreasing_batch_grouped) {
911 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
912 ConvolutionOperatorTester()
913 .batch_size(5)
914 .next_batch_size(3)
915 .input_height(8)
916 .input_width(8)
917 .kernel_height(5)
918 .kernel_width(3)
919 .groups(2)
920 .group_input_channels(15)
921 .group_output_channels(17)
922 .TestSetupNHWCxQ8();
923 }
924
TEST(CONVOLUTION_NHWC_Q8,setup_decreasing_batch_depthwise)925 TEST(CONVOLUTION_NHWC_Q8, setup_decreasing_batch_depthwise) {
926 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
927 ConvolutionOperatorTester()
928 .batch_size(5)
929 .next_batch_size(3)
930 .input_height(8)
931 .input_width(8)
932 .kernel_height(3)
933 .kernel_width(3)
934 .groups(19)
935 .group_input_channels(1)
936 .group_output_channels(1)
937 .TestSetupNHWCxQ8();
938 }
939
TEST(CONVOLUTION_NHWC_Q8,setup_changing_height)940 TEST(CONVOLUTION_NHWC_Q8, setup_changing_height) {
941 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
942 ConvolutionOperatorTester()
943 .batch_size(3)
944 .input_height(8)
945 .input_width(8)
946 .next_input_height(9)
947 .kernel_height(5)
948 .kernel_width(3)
949 .group_input_channels(15)
950 .group_output_channels(17)
951 .TestSetupNHWCxQ8();
952 ConvolutionOperatorTester()
953 .batch_size(3)
954 .input_height(8)
955 .input_width(8)
956 .next_input_height(7)
957 .kernel_height(5)
958 .kernel_width(3)
959 .group_input_channels(15)
960 .group_output_channels(17)
961 .TestSetupNHWCxQ8();
962 }
963
TEST(CONVOLUTION_NHWC_Q8,setup_changing_height_grouped)964 TEST(CONVOLUTION_NHWC_Q8, setup_changing_height_grouped) {
965 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
966 ConvolutionOperatorTester()
967 .batch_size(3)
968 .input_height(8)
969 .input_width(8)
970 .next_input_height(9)
971 .kernel_height(5)
972 .kernel_width(3)
973 .groups(2)
974 .group_input_channels(15)
975 .group_output_channels(17)
976 .TestSetupNHWCxQ8();
977 ConvolutionOperatorTester()
978 .batch_size(3)
979 .input_height(8)
980 .input_width(8)
981 .next_input_height(7)
982 .kernel_height(5)
983 .kernel_width(3)
984 .groups(2)
985 .group_input_channels(15)
986 .group_output_channels(17)
987 .TestSetupNHWCxQ8();
988 }
989
TEST(CONVOLUTION_NHWC_Q8,setup_changing_height_depthwise)990 TEST(CONVOLUTION_NHWC_Q8, setup_changing_height_depthwise) {
991 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
992 ConvolutionOperatorTester()
993 .batch_size(3)
994 .input_height(8)
995 .input_width(8)
996 .next_input_height(9)
997 .kernel_height(3)
998 .kernel_width(3)
999 .groups(19)
1000 .group_input_channels(1)
1001 .group_output_channels(1)
1002 .TestSetupNHWCxQ8();
1003 ConvolutionOperatorTester()
1004 .batch_size(3)
1005 .input_height(8)
1006 .input_width(8)
1007 .next_input_height(7)
1008 .kernel_height(3)
1009 .kernel_width(3)
1010 .groups(19)
1011 .group_input_channels(1)
1012 .group_output_channels(1)
1013 .TestSetupNHWCxQ8();
1014 }
1015
TEST(CONVOLUTION_NHWC_Q8,setup_changing_width)1016 TEST(CONVOLUTION_NHWC_Q8, setup_changing_width) {
1017 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1018 ConvolutionOperatorTester()
1019 .batch_size(3)
1020 .input_height(8)
1021 .input_width(8)
1022 .next_input_width(9)
1023 .kernel_height(5)
1024 .kernel_width(3)
1025 .group_input_channels(15)
1026 .group_output_channels(17)
1027 .TestSetupNHWCxQ8();
1028 ConvolutionOperatorTester()
1029 .batch_size(3)
1030 .input_height(8)
1031 .input_width(8)
1032 .next_input_width(7)
1033 .kernel_height(5)
1034 .kernel_width(3)
1035 .group_input_channels(15)
1036 .group_output_channels(17)
1037 .TestSetupNHWCxQ8();
1038 }
1039
TEST(CONVOLUTION_NHWC_Q8,setup_changing_width_grouped)1040 TEST(CONVOLUTION_NHWC_Q8, setup_changing_width_grouped) {
1041 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1042 ConvolutionOperatorTester()
1043 .batch_size(3)
1044 .input_height(8)
1045 .input_width(8)
1046 .next_input_width(9)
1047 .kernel_height(5)
1048 .kernel_width(3)
1049 .groups(2)
1050 .group_input_channels(15)
1051 .group_output_channels(17)
1052 .TestSetupNHWCxQ8();
1053 ConvolutionOperatorTester()
1054 .batch_size(3)
1055 .input_height(8)
1056 .input_width(8)
1057 .next_input_width(7)
1058 .kernel_height(5)
1059 .kernel_width(3)
1060 .groups(2)
1061 .group_input_channels(15)
1062 .group_output_channels(17)
1063 .TestSetupNHWCxQ8();
1064 }
1065
TEST(CONVOLUTION_NHWC_Q8,setup_changing_width_depthwise)1066 TEST(CONVOLUTION_NHWC_Q8, setup_changing_width_depthwise) {
1067 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1068 ConvolutionOperatorTester()
1069 .batch_size(3)
1070 .input_height(8)
1071 .input_width(8)
1072 .next_input_width(9)
1073 .kernel_height(3)
1074 .kernel_width(3)
1075 .groups(19)
1076 .group_input_channels(1)
1077 .group_output_channels(1)
1078 .TestSetupNHWCxQ8();
1079 ConvolutionOperatorTester()
1080 .batch_size(3)
1081 .input_height(8)
1082 .input_width(8)
1083 .next_input_width(7)
1084 .kernel_height(3)
1085 .kernel_width(3)
1086 .groups(19)
1087 .group_input_channels(1)
1088 .group_output_channels(1)
1089 .TestSetupNHWCxQ8();
1090 }
1091
TEST(CONVOLUTION_NHWC_Q8,setup_swap_height_and_width)1092 TEST(CONVOLUTION_NHWC_Q8, setup_swap_height_and_width) {
1093 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1094 ConvolutionOperatorTester()
1095 .batch_size(3)
1096 .input_height(9)
1097 .input_width(8)
1098 .next_input_height(8)
1099 .next_input_width(9)
1100 .kernel_height(5)
1101 .kernel_width(3)
1102 .group_input_channels(15)
1103 .group_output_channels(17)
1104 .TestSetupNHWCxQ8();
1105 }
1106
TEST(CONVOLUTION_NHWC_Q8,setup_swap_height_and_width_grouped)1107 TEST(CONVOLUTION_NHWC_Q8, setup_swap_height_and_width_grouped) {
1108 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1109 ConvolutionOperatorTester()
1110 .batch_size(3)
1111 .input_height(9)
1112 .input_width(8)
1113 .next_input_height(8)
1114 .next_input_width(9)
1115 .kernel_height(5)
1116 .kernel_width(3)
1117 .groups(2)
1118 .group_input_channels(15)
1119 .group_output_channels(17)
1120 .TestSetupNHWCxQ8();
1121 }
1122
TEST(CONVOLUTION_NHWC_Q8,setup_swap_height_and_width_depthwise)1123 TEST(CONVOLUTION_NHWC_Q8, setup_swap_height_and_width_depthwise) {
1124 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1125 ConvolutionOperatorTester()
1126 .batch_size(3)
1127 .input_height(9)
1128 .input_width(8)
1129 .next_input_height(8)
1130 .next_input_width(9)
1131 .kernel_height(3)
1132 .kernel_width(3)
1133 .groups(19)
1134 .group_input_channels(1)
1135 .group_output_channels(1)
1136 .TestSetupNHWCxQ8();
1137 }
1138
1139 TEST(CONVOLUTION_NHWC_F32, 1x1) {
1140 ConvolutionOperatorTester()
1141 .input_size(27, 29)
1142 .kernel_size(1, 1)
1143 .group_input_channels(23)
1144 .group_output_channels(19)
1145 .iterations(3)
1146 .TestNHWCxF32();
1147 }
1148
1149 TEST(CONVOLUTION_NHWC_F32, 1x1_with_qmin) {
1150 ConvolutionOperatorTester()
1151 .input_size(27, 29)
1152 .kernel_size(1, 1)
1153 .group_input_channels(23)
1154 .group_output_channels(19)
1155 .qmin(128)
1156 .iterations(3)
1157 .TestNHWCxF32();
1158 }
1159
1160 TEST(CONVOLUTION_NHWC_F32, 1x1_with_qmax) {
1161 ConvolutionOperatorTester()
1162 .input_size(27, 29)
1163 .kernel_size(1, 1)
1164 .group_input_channels(23)
1165 .group_output_channels(19)
1166 .qmax(128)
1167 .iterations(3)
1168 .TestNHWCxF32();
1169 }
1170
1171 TEST(CONVOLUTION_NHWC_F32, 1x1_with_input_stride) {
1172 ConvolutionOperatorTester()
1173 .input_size(27, 29)
1174 .kernel_size(1, 1)
1175 .input_pixel_stride(28)
1176 .group_input_channels(23)
1177 .group_output_channels(19)
1178 .iterations(3)
1179 .TestNHWCxF32();
1180 }
1181
1182 TEST(CONVOLUTION_NHWC_F32, 1x1_with_output_stride) {
1183 ConvolutionOperatorTester()
1184 .input_size(27, 29)
1185 .kernel_size(1, 1)
1186 .output_pixel_stride(29)
1187 .group_input_channels(23)
1188 .group_output_channels(19)
1189 .iterations(3)
1190 .TestNHWCxF32();
1191 }
1192
1193 TEST(CONVOLUTION_NHWC_F32, 1x1_without_bias) {
1194 ConvolutionOperatorTester()
1195 .has_bias(false)
1196 .input_size(13, 14)
1197 .kernel_size(1, 1)
1198 .group_input_channels(23)
1199 .group_output_channels(19)
1200 .iterations(3)
1201 .TestNHWCxF32();
1202 }
1203
1204 TEST(CONVOLUTION_NHWC_F32, 1x1_with_batch) {
1205 ConvolutionOperatorTester()
1206 .batch_size(3)
1207 .input_size(13, 14)
1208 .kernel_size(1, 1)
1209 .group_input_channels(23)
1210 .group_output_channels(19)
1211 .iterations(3)
1212 .TestNHWCxF32();
1213 }
1214
TEST(CONVOLUTION_NHWC_F32,grouped_1x1)1215 TEST(CONVOLUTION_NHWC_F32, grouped_1x1) {
1216 ConvolutionOperatorTester()
1217 .input_size(24, 25)
1218 .kernel_size(1, 1)
1219 .groups(2)
1220 .group_input_channels(17)
1221 .group_output_channels(19)
1222 .iterations(3)
1223 .TestNHWCxF32();
1224 }
1225
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_with_qmin)1226 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_with_qmin) {
1227 ConvolutionOperatorTester()
1228 .input_size(24, 25)
1229 .kernel_size(1, 1)
1230 .groups(2)
1231 .group_input_channels(17)
1232 .group_output_channels(19)
1233 .qmin(128)
1234 .iterations(3)
1235 .TestNHWCxF32();
1236 }
1237
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_with_qmax)1238 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_with_qmax) {
1239 ConvolutionOperatorTester()
1240 .input_size(24, 25)
1241 .kernel_size(1, 1)
1242 .groups(2)
1243 .group_input_channels(17)
1244 .group_output_channels(19)
1245 .qmax(128)
1246 .iterations(3)
1247 .TestNHWCxF32();
1248 }
1249
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_with_input_stride)1250 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_with_input_stride) {
1251 ConvolutionOperatorTester()
1252 .input_size(24, 25)
1253 .kernel_size(1, 1)
1254 .groups(2)
1255 .input_pixel_stride(37)
1256 .group_input_channels(17)
1257 .group_output_channels(19)
1258 .iterations(3)
1259 .TestNHWCxF32();
1260 }
1261
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_with_output_stride)1262 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_with_output_stride) {
1263 ConvolutionOperatorTester()
1264 .input_size(24, 25)
1265 .kernel_size(1, 1)
1266 .groups(2)
1267 .output_pixel_stride(41)
1268 .group_input_channels(17)
1269 .group_output_channels(19)
1270 .iterations(3)
1271 .TestNHWCxF32();
1272 }
1273
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_without_bias)1274 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_without_bias) {
1275 ConvolutionOperatorTester()
1276 .has_bias(false)
1277 .input_size(24, 25)
1278 .kernel_size(1, 1)
1279 .groups(2)
1280 .group_input_channels(17)
1281 .group_output_channels(19)
1282 .iterations(3)
1283 .TestNHWCxF32();
1284 }
1285
TEST(CONVOLUTION_NHWC_F32,grouped_1x1_with_batch)1286 TEST(CONVOLUTION_NHWC_F32, grouped_1x1_with_batch) {
1287 ConvolutionOperatorTester()
1288 .batch_size(3)
1289 .input_size(24, 25)
1290 .kernel_size(1, 1)
1291 .groups(2)
1292 .group_input_channels(17)
1293 .group_output_channels(19)
1294 .iterations(3)
1295 .TestNHWCxF32();
1296 }
1297
TEST(CONVOLUTION_NHWC_F32,unioutput_1x1)1298 TEST(CONVOLUTION_NHWC_F32, unioutput_1x1) {
1299 ConvolutionOperatorTester()
1300 .input_size(1, 1)
1301 .kernel_size(1, 1)
1302 .group_input_channels(23)
1303 .group_output_channels(19)
1304 .iterations(3)
1305 .TestNHWCxF32();
1306 }
1307
TEST(CONVOLUTION_NHWC_F32,unioutput_1x1_with_qmin)1308 TEST(CONVOLUTION_NHWC_F32, unioutput_1x1_with_qmin) {
1309 ConvolutionOperatorTester()
1310 .input_size(1, 1)
1311 .kernel_size(1, 1)
1312 .group_input_channels(23)
1313 .group_output_channels(19)
1314 .qmin(128)
1315 .iterations(3)
1316 .TestNHWCxF32();
1317 }
1318
TEST(CONVOLUTION_NHWC_F32,unioutput_1x1_with_qmax)1319 TEST(CONVOLUTION_NHWC_F32, unioutput_1x1_with_qmax) {
1320 ConvolutionOperatorTester()
1321 .input_size(1, 1)
1322 .kernel_size(1, 1)
1323 .group_input_channels(23)
1324 .group_output_channels(19)
1325 .qmax(128)
1326 .iterations(3)
1327 .TestNHWCxF32();
1328 }
1329
TEST(CONVOLUTION_NHWC_F32,unioutput_1x1_with_input_stride)1330 TEST(CONVOLUTION_NHWC_F32, unioutput_1x1_with_input_stride) {
1331 ConvolutionOperatorTester()
1332 .input_size(1, 1)
1333 .kernel_size(1, 1)
1334 .input_pixel_stride(28)
1335 .group_input_channels(23)
1336 .group_output_channels(19)
1337 .iterations(3)
1338 .TestNHWCxF32();
1339 }
1340
TEST(CONVOLUTION_NHWC_F32,unioutput_1x1_with_output_stride)1341 TEST(CONVOLUTION_NHWC_F32, unioutput_1x1_with_output_stride) {
1342 ConvolutionOperatorTester()
1343 .input_size(1, 1)
1344 .kernel_size(1, 1)
1345 .output_pixel_stride(29)
1346 .group_input_channels(23)
1347 .group_output_channels(19)
1348 .iterations(3)
1349 .TestNHWCxF32();
1350 }
1351
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_1x1)1352 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_1x1) {
1353 ConvolutionOperatorTester()
1354 .input_size(1, 1)
1355 .kernel_size(1, 1)
1356 .groups(2)
1357 .group_input_channels(17)
1358 .group_output_channels(13)
1359 .iterations(3)
1360 .TestNHWCxF32();
1361 }
1362
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_1x1_with_qmin)1363 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_1x1_with_qmin) {
1364 ConvolutionOperatorTester()
1365 .input_size(1, 1)
1366 .kernel_size(1, 1)
1367 .groups(2)
1368 .group_input_channels(17)
1369 .group_output_channels(13)
1370 .qmin(128)
1371 .iterations(3)
1372 .TestNHWCxF32();
1373 }
1374
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_1x1_with_qmax)1375 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_1x1_with_qmax) {
1376 ConvolutionOperatorTester()
1377 .input_size(1, 1)
1378 .kernel_size(1, 1)
1379 .groups(2)
1380 .group_input_channels(17)
1381 .group_output_channels(13)
1382 .qmax(128)
1383 .iterations(3)
1384 .TestNHWCxF32();
1385 }
1386
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_1x1_with_input_stride)1387 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_1x1_with_input_stride) {
1388 ConvolutionOperatorTester()
1389 .input_size(1, 1)
1390 .kernel_size(1, 1)
1391 .groups(2)
1392 .input_pixel_stride(37)
1393 .group_input_channels(17)
1394 .group_output_channels(13)
1395 .iterations(3)
1396 .TestNHWCxF32();
1397 }
1398
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_1x1_with_output_stride)1399 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_1x1_with_output_stride) {
1400 ConvolutionOperatorTester()
1401 .input_size(1, 1)
1402 .kernel_size(1, 1)
1403 .groups(2)
1404 .output_pixel_stride(41)
1405 .group_input_channels(17)
1406 .group_output_channels(13)
1407 .iterations(3)
1408 .TestNHWCxF32();
1409 }
1410
1411 TEST(CONVOLUTION_NHWC_F32, 1x3) {
1412 ConvolutionOperatorTester()
1413 .input_size(20, 19)
1414 .padding_width(1)
1415 .kernel_size(1, 3)
1416 .group_input_channels(17)
1417 .group_output_channels(15)
1418 .iterations(3)
1419 .TestNHWCxF32();
1420 }
1421
TEST(CONVOLUTION_NHWC_F32,grouped_1x3)1422 TEST(CONVOLUTION_NHWC_F32, grouped_1x3) {
1423 ConvolutionOperatorTester()
1424 .input_size(20, 19)
1425 .padding_width(1)
1426 .kernel_size(1, 3)
1427 .groups(2)
1428 .group_input_channels(17)
1429 .group_output_channels(15)
1430 .iterations(3)
1431 .TestNHWCxF32();
1432 }
1433
1434 TEST(CONVOLUTION_NHWC_F32, 3x1) {
1435 ConvolutionOperatorTester()
1436 .input_size(19, 20)
1437 .padding_height(1)
1438 .kernel_size(3, 1)
1439 .group_input_channels(17)
1440 .group_output_channels(15)
1441 .iterations(3)
1442 .TestNHWCxF32();
1443 }
1444
TEST(CONVOLUTION_NHWC_F32,grouped_3x1)1445 TEST(CONVOLUTION_NHWC_F32, grouped_3x1) {
1446 ConvolutionOperatorTester()
1447 .input_size(19, 20)
1448 .padding_height(1)
1449 .kernel_size(3, 1)
1450 .groups(2)
1451 .group_input_channels(17)
1452 .group_output_channels(15)
1453 .iterations(3)
1454 .TestNHWCxF32();
1455 }
1456
1457 TEST(CONVOLUTION_NHWC_F32, 3x3) {
1458 ConvolutionOperatorTester()
1459 .input_size(13, 12)
1460 .padding(1)
1461 .kernel_size(3, 3)
1462 .group_input_channels(15)
1463 .group_output_channels(17)
1464 .iterations(3)
1465 .TestNHWCxF32();
1466 }
1467
1468 TEST(CONVOLUTION_NHWC_F32, 3x3_without_padding) {
1469 ConvolutionOperatorTester()
1470 .input_size(13, 12)
1471 .kernel_size(3, 3)
1472 .group_input_channels(15)
1473 .group_output_channels(17)
1474 .iterations(3)
1475 .TestNHWCxF32();
1476 }
1477
1478 TEST(CONVOLUTION_NHWC_F32, 3x3_with_left_padding) {
1479 ConvolutionOperatorTester()
1480 .input_size(13, 12)
1481 .padding_left(1)
1482 .kernel_size(3, 3)
1483 .group_input_channels(15)
1484 .group_output_channels(17)
1485 .iterations(3)
1486 .TestNHWCxF32();
1487 }
1488
1489 TEST(CONVOLUTION_NHWC_F32, 3x3_with_right_padding) {
1490 ConvolutionOperatorTester()
1491 .input_size(13, 12)
1492 .padding_right(1)
1493 .kernel_size(3, 3)
1494 .group_input_channels(15)
1495 .group_output_channels(17)
1496 .iterations(3)
1497 .TestNHWCxF32();
1498 }
1499
1500 TEST(CONVOLUTION_NHWC_F32, 3x3_with_top_padding) {
1501 ConvolutionOperatorTester()
1502 .input_size(13, 12)
1503 .padding_top(1)
1504 .kernel_size(3, 3)
1505 .group_input_channels(15)
1506 .group_output_channels(17)
1507 .iterations(3)
1508 .TestNHWCxF32();
1509 }
1510
1511 TEST(CONVOLUTION_NHWC_F32, 3x3_with_bottom_padding) {
1512 ConvolutionOperatorTester()
1513 .input_size(13, 12)
1514 .padding_bottom(1)
1515 .kernel_size(3, 3)
1516 .group_input_channels(15)
1517 .group_output_channels(17)
1518 .iterations(3)
1519 .TestNHWCxF32();
1520 }
1521
1522 TEST(CONVOLUTION_NHWC_F32, 3x3_with_input_stride) {
1523 ConvolutionOperatorTester()
1524 .input_size(13, 12)
1525 .padding(1)
1526 .kernel_size(3, 3)
1527 .input_pixel_stride(22)
1528 .group_input_channels(15)
1529 .group_output_channels(17)
1530 .iterations(3)
1531 .TestNHWCxF32();
1532 }
1533
1534 TEST(CONVOLUTION_NHWC_F32, 3x3_with_output_stride) {
1535 ConvolutionOperatorTester()
1536 .input_size(13, 12)
1537 .padding(1)
1538 .kernel_size(3, 3)
1539 .output_pixel_stride(23)
1540 .group_input_channels(15)
1541 .group_output_channels(17)
1542 .iterations(3)
1543 .TestNHWCxF32();
1544 }
1545
1546 TEST(CONVOLUTION_NHWC_F32, 3x3_without_bias) {
1547 ConvolutionOperatorTester()
1548 .has_bias(false)
1549 .input_size(10, 9)
1550 .padding(1)
1551 .kernel_size(3, 3)
1552 .group_input_channels(15)
1553 .group_output_channels(17)
1554 .iterations(3)
1555 .TestNHWCxF32();
1556 }
1557
1558 TEST(CONVOLUTION_NHWC_F32, 3x3_with_batch) {
1559 ConvolutionOperatorTester()
1560 .batch_size(3)
1561 .input_size(10, 9)
1562 .padding(1)
1563 .kernel_size(3, 3)
1564 .group_input_channels(15)
1565 .group_output_channels(17)
1566 .iterations(3)
1567 .TestNHWCxF32();
1568 }
1569
TEST(CONVOLUTION_NHWC_F32,grouped_3x3)1570 TEST(CONVOLUTION_NHWC_F32, grouped_3x3) {
1571 ConvolutionOperatorTester()
1572 .input_size(10, 11)
1573 .padding(1)
1574 .kernel_size(3, 3)
1575 .groups(2)
1576 .group_input_channels(14)
1577 .group_output_channels(13)
1578 .iterations(3)
1579 .TestNHWCxF32();
1580 }
1581
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_without_padding)1582 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_without_padding) {
1583 ConvolutionOperatorTester()
1584 .input_size(13, 12)
1585 .kernel_size(3, 3)
1586 .group_input_channels(15)
1587 .group_output_channels(17)
1588 .iterations(3)
1589 .TestNHWCxF32();
1590 }
1591
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_left_padding)1592 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_left_padding) {
1593 ConvolutionOperatorTester()
1594 .input_size(10, 11)
1595 .padding_left(1)
1596 .kernel_size(3, 3)
1597 .groups(2)
1598 .group_input_channels(14)
1599 .group_output_channels(13)
1600 .iterations(3)
1601 .TestNHWCxF32();
1602 }
1603
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_right_padding)1604 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_right_padding) {
1605 ConvolutionOperatorTester()
1606 .input_size(10, 11)
1607 .padding_right(1)
1608 .kernel_size(3, 3)
1609 .groups(2)
1610 .group_input_channels(14)
1611 .group_output_channels(13)
1612 .iterations(3)
1613 .TestNHWCxF32();
1614 }
1615
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_top_padding)1616 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_top_padding) {
1617 ConvolutionOperatorTester()
1618 .input_size(10, 11)
1619 .padding_top(1)
1620 .kernel_size(3, 3)
1621 .groups(2)
1622 .group_input_channels(14)
1623 .group_output_channels(13)
1624 .iterations(3)
1625 .TestNHWCxF32();
1626 }
1627
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_bottom_padding)1628 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_bottom_padding) {
1629 ConvolutionOperatorTester()
1630 .input_size(10, 11)
1631 .padding_bottom(1)
1632 .kernel_size(3, 3)
1633 .groups(2)
1634 .group_input_channels(14)
1635 .group_output_channels(13)
1636 .iterations(3)
1637 .TestNHWCxF32();
1638 }
1639
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_input_stride)1640 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_input_stride) {
1641 ConvolutionOperatorTester()
1642 .input_size(10, 11)
1643 .padding(1)
1644 .kernel_size(3, 3)
1645 .groups(2)
1646 .input_pixel_stride(29)
1647 .group_input_channels(14)
1648 .group_output_channels(13)
1649 .iterations(3)
1650 .TestNHWCxF32();
1651 }
1652
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_output_stride)1653 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_output_stride) {
1654 ConvolutionOperatorTester()
1655 .input_size(10, 11)
1656 .padding(1)
1657 .kernel_size(3, 3)
1658 .groups(2)
1659 .output_pixel_stride(31)
1660 .group_input_channels(14)
1661 .group_output_channels(13)
1662 .iterations(3)
1663 .TestNHWCxF32();
1664 }
1665
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_without_bias)1666 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_without_bias) {
1667 ConvolutionOperatorTester()
1668 .has_bias(false)
1669 .input_size(10, 11)
1670 .padding(1)
1671 .kernel_size(3, 3)
1672 .groups(2)
1673 .group_input_channels(14)
1674 .group_output_channels(13)
1675 .iterations(3)
1676 .TestNHWCxF32();
1677 }
1678
TEST(CONVOLUTION_NHWC_F32,grouped_3x3_with_batch)1679 TEST(CONVOLUTION_NHWC_F32, grouped_3x3_with_batch) {
1680 ConvolutionOperatorTester()
1681 .batch_size(3)
1682 .input_size(10, 11)
1683 .padding(1)
1684 .kernel_size(3, 3)
1685 .groups(2)
1686 .group_input_channels(14)
1687 .group_output_channels(13)
1688 .iterations(3)
1689 .TestNHWCxF32();
1690 }
1691
1692 TEST(CONVOLUTION_NHWC_F32, 3x3s2) {
1693 ConvolutionOperatorTester()
1694 .input_size(14, 13)
1695 .padding(1)
1696 .kernel_size(3, 3)
1697 .subsampling(2)
1698 .group_input_channels(27)
1699 .group_output_channels(19)
1700 .iterations(3)
1701 .TestNHWCxF32();
1702 }
1703
1704 TEST(CONVOLUTION_NHWC_F32, 3x3s2_with_tf_same_padding) {
1705 for (size_t input_height = 13; input_height <= 14; input_height++) {
1706 for (size_t input_width = 13; input_width <= 14; input_width++) {
1707 ConvolutionOperatorTester()
1708 .input_size(input_height, input_width)
1709 .padding_tf_same(true)
1710 .kernel_size(3, 3)
1711 .subsampling(2)
1712 .group_input_channels(27)
1713 .group_output_channels(19)
1714 .iterations(3)
1715 .TestNHWCxF32();
1716 }
1717 }
1718 }
1719
1720 TEST(CONVOLUTION_NHWC_F32, 3x3s1x2) {
1721 ConvolutionOperatorTester()
1722 .input_size(14, 13)
1723 .padding(1)
1724 .kernel_size(3, 3)
1725 .subsampling(1, 2)
1726 .group_input_channels(27)
1727 .group_output_channels(19)
1728 .iterations(3)
1729 .TestNHWCxF32();
1730 }
1731
1732 TEST(CONVOLUTION_NHWC_F32, 3x3s1x2_with_tf_same_padding) {
1733 for (size_t input_height = 13; input_height <= 14; input_height++) {
1734 for (size_t input_width = 13; input_width <= 14; input_width++) {
1735 ConvolutionOperatorTester()
1736 .input_size(input_height, input_width)
1737 .padding_tf_same(true)
1738 .kernel_size(3, 3)
1739 .subsampling(1, 2)
1740 .group_input_channels(27)
1741 .group_output_channels(19)
1742 .iterations(3)
1743 .TestNHWCxF32();
1744 }
1745 }
1746 }
1747
1748 TEST(CONVOLUTION_NHWC_F32, 3x3s2x1) {
1749 ConvolutionOperatorTester()
1750 .input_size(14, 13)
1751 .padding(1)
1752 .kernel_size(3, 3)
1753 .subsampling(2, 1)
1754 .group_input_channels(27)
1755 .group_output_channels(19)
1756 .iterations(3)
1757 .TestNHWCxF32();
1758 }
1759
1760 TEST(CONVOLUTION_NHWC_F32, 3x3s2x1_with_tf_same_padding) {
1761 for (size_t input_height = 13; input_height <= 14; input_height++) {
1762 for (size_t input_width = 13; input_width <= 14; input_width++) {
1763 ConvolutionOperatorTester()
1764 .input_size(input_height, input_width)
1765 .padding_tf_same(true)
1766 .kernel_size(3, 3)
1767 .subsampling(2, 1)
1768 .group_input_channels(27)
1769 .group_output_channels(19)
1770 .iterations(3)
1771 .TestNHWCxF32();
1772 }
1773 }
1774 }
1775
1776 TEST(CONVOLUTION_NHWC_F32, 3x3d2) {
1777 ConvolutionOperatorTester()
1778 .input_size(13, 14)
1779 .padding(2)
1780 .kernel_size(3, 3)
1781 .dilation(2)
1782 .group_input_channels(27)
1783 .group_output_channels(19)
1784 .iterations(3)
1785 .TestNHWCxF32();
1786 }
1787
1788 TEST(CONVOLUTION_NHWC_F32, 3x3d1x2) {
1789 ConvolutionOperatorTester()
1790 .input_size(14, 15)
1791 .padding(1, 2)
1792 .kernel_size(3, 3)
1793 .dilation(1, 2)
1794 .group_input_channels(27)
1795 .group_output_channels(19)
1796 .iterations(3)
1797 .TestNHWCxF32();
1798 }
1799
1800 TEST(CONVOLUTION_NHWC_F32, 3x3d2x1) {
1801 ConvolutionOperatorTester()
1802 .input_size(15, 14)
1803 .padding(2, 1)
1804 .kernel_size(3, 3)
1805 .dilation(2, 1)
1806 .group_input_channels(27)
1807 .group_output_channels(19)
1808 .iterations(3)
1809 .TestNHWCxF32();
1810 }
1811
TEST(CONVOLUTION_NHWC_F32,unioutput_3x3)1812 TEST(CONVOLUTION_NHWC_F32, unioutput_3x3) {
1813 ConvolutionOperatorTester()
1814 .input_size(3, 3)
1815 .padding(1)
1816 .kernel_size(3, 3)
1817 .group_input_channels(23)
1818 .group_output_channels(19)
1819 .iterations(3)
1820 .TestNHWCxF32();
1821 }
1822
TEST(CONVOLUTION_NHWC_F32,unioutput_3x3_with_qmin)1823 TEST(CONVOLUTION_NHWC_F32, unioutput_3x3_with_qmin) {
1824 ConvolutionOperatorTester()
1825 .input_size(3, 3)
1826 .padding(1)
1827 .kernel_size(3, 3)
1828 .group_input_channels(23)
1829 .group_output_channels(19)
1830 .qmin(128)
1831 .iterations(3)
1832 .TestNHWCxF32();
1833 }
1834
TEST(CONVOLUTION_NHWC_F32,unioutput_3x3_with_qmax)1835 TEST(CONVOLUTION_NHWC_F32, unioutput_3x3_with_qmax) {
1836 ConvolutionOperatorTester()
1837 .input_size(3, 3)
1838 .padding(1)
1839 .kernel_size(3, 3)
1840 .group_input_channels(23)
1841 .group_output_channels(19)
1842 .qmax(128)
1843 .iterations(3)
1844 .TestNHWCxF32();
1845 }
1846
TEST(CONVOLUTION_NHWC_F32,unioutput_3x3_with_input_stride)1847 TEST(CONVOLUTION_NHWC_F32, unioutput_3x3_with_input_stride) {
1848 ConvolutionOperatorTester()
1849 .input_size(3, 3)
1850 .padding(1)
1851 .kernel_size(3, 3)
1852 .input_pixel_stride(28)
1853 .group_input_channels(23)
1854 .group_output_channels(19)
1855 .iterations(3)
1856 .TestNHWCxF32();
1857 }
1858
TEST(CONVOLUTION_NHWC_F32,unioutput_3x3_with_output_stride)1859 TEST(CONVOLUTION_NHWC_F32, unioutput_3x3_with_output_stride) {
1860 ConvolutionOperatorTester()
1861 .input_size(3, 3)
1862 .padding(1)
1863 .kernel_size(3, 3)
1864 .output_pixel_stride(29)
1865 .group_input_channels(23)
1866 .group_output_channels(19)
1867 .iterations(3)
1868 .TestNHWCxF32();
1869 }
1870
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_3x3)1871 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_3x3) {
1872 ConvolutionOperatorTester()
1873 .input_size(3, 3)
1874 .padding(1)
1875 .kernel_size(3, 3)
1876 .groups(2)
1877 .group_input_channels(17)
1878 .group_output_channels(13)
1879 .iterations(3)
1880 .TestNHWCxF32();
1881 }
1882
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_3x3_with_qmin)1883 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_3x3_with_qmin) {
1884 ConvolutionOperatorTester()
1885 .input_size(3, 3)
1886 .padding(1)
1887 .kernel_size(3, 3)
1888 .groups(2)
1889 .group_input_channels(17)
1890 .group_output_channels(13)
1891 .qmin(128)
1892 .iterations(3)
1893 .TestNHWCxF32();
1894 }
1895
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_3x3_with_qmax)1896 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_3x3_with_qmax) {
1897 ConvolutionOperatorTester()
1898 .input_size(3, 3)
1899 .padding(1)
1900 .kernel_size(3, 3)
1901 .groups(2)
1902 .group_input_channels(17)
1903 .group_output_channels(13)
1904 .qmax(128)
1905 .iterations(3)
1906 .TestNHWCxF32();
1907 }
1908
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_3x3_with_input_stride)1909 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_3x3_with_input_stride) {
1910 ConvolutionOperatorTester()
1911 .input_size(3, 3)
1912 .padding(1)
1913 .kernel_size(3, 3)
1914 .groups(2)
1915 .input_pixel_stride(37)
1916 .group_input_channels(17)
1917 .group_output_channels(13)
1918 .iterations(3)
1919 .TestNHWCxF32();
1920 }
1921
TEST(CONVOLUTION_NHWC_F32,unioutput_grouped_3x3_with_output_stride)1922 TEST(CONVOLUTION_NHWC_F32, unioutput_grouped_3x3_with_output_stride) {
1923 ConvolutionOperatorTester()
1924 .input_size(3, 3)
1925 .padding(1)
1926 .kernel_size(3, 3)
1927 .groups(2)
1928 .output_pixel_stride(41)
1929 .group_input_channels(17)
1930 .group_output_channels(13)
1931 .iterations(3)
1932 .TestNHWCxF32();
1933 }
1934
TEST(CONVOLUTION_NHWC_F32,depthwise_1x1)1935 TEST(CONVOLUTION_NHWC_F32, depthwise_1x1) {
1936 ConvolutionOperatorTester()
1937 .input_size(15, 14)
1938 .kernel_size(1, 1)
1939 .groups(24)
1940 .iterations(3)
1941 .TestNHWCxF32();
1942 }
1943
TEST(CONVOLUTION_NHWC_F32,depthwise_1x1_without_bias)1944 TEST(CONVOLUTION_NHWC_F32, depthwise_1x1_without_bias) {
1945 ConvolutionOperatorTester()
1946 .has_bias(false)
1947 .input_size(15, 14)
1948 .kernel_size(1, 1)
1949 .groups(24)
1950 .iterations(3)
1951 .TestNHWCxF32();
1952 }
1953
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2)1954 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2) {
1955 ConvolutionOperatorTester()
1956 .input_size(15, 14)
1957 .padding(1, 1)
1958 .kernel_size(2, 2)
1959 .groups(24)
1960 .iterations(3)
1961 .TestNHWCxF32();
1962 }
1963
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2_without_bias)1964 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2_without_bias) {
1965 ConvolutionOperatorTester()
1966 .has_bias(false)
1967 .input_size(15, 14)
1968 .padding(1, 1)
1969 .kernel_size(2, 2)
1970 .groups(24)
1971 .iterations(3)
1972 .TestNHWCxF32();
1973 }
1974
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2s2)1975 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2s2) {
1976 ConvolutionOperatorTester()
1977 .input_size(15, 14)
1978 .padding(1, 1)
1979 .kernel_size(2, 2)
1980 .subsampling(2)
1981 .groups(27)
1982 .iterations(3)
1983 .TestNHWCxF32();
1984 }
1985
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2s1x2)1986 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2s1x2) {
1987 ConvolutionOperatorTester()
1988 .input_size(15, 14)
1989 .padding(1, 1)
1990 .kernel_size(2, 2)
1991 .subsampling(1, 2)
1992 .groups(27)
1993 .iterations(3)
1994 .TestNHWCxF32();
1995 }
1996
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2s2x1)1997 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2s2x1) {
1998 ConvolutionOperatorTester()
1999 .input_size(15, 14)
2000 .padding(1, 1)
2001 .kernel_size(2, 2)
2002 .subsampling(2, 1)
2003 .groups(27)
2004 .iterations(3)
2005 .TestNHWCxF32();
2006 }
2007
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2d2)2008 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2d2) {
2009 ConvolutionOperatorTester()
2010 .input_size(15, 14)
2011 .padding(1, 1)
2012 .kernel_size(2, 2)
2013 .dilation(2)
2014 .groups(27)
2015 .iterations(3)
2016 .TestNHWCxF32();
2017 }
2018
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2d1x2)2019 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2d1x2) {
2020 ConvolutionOperatorTester()
2021 .input_size(15, 14)
2022 .padding(1, 1)
2023 .kernel_size(2, 2)
2024 .dilation(1, 2)
2025 .groups(27)
2026 .iterations(3)
2027 .TestNHWCxF32();
2028 }
2029
TEST(CONVOLUTION_NHWC_F32,depthwise_2x2d2x1)2030 TEST(CONVOLUTION_NHWC_F32, depthwise_2x2d2x1) {
2031 ConvolutionOperatorTester()
2032 .input_size(15, 14)
2033 .padding(1, 1)
2034 .kernel_size(2, 2)
2035 .dilation(2, 1)
2036 .groups(27)
2037 .iterations(3)
2038 .TestNHWCxF32();
2039 }
2040
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3)2041 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3) {
2042 ConvolutionOperatorTester()
2043 .input_size(15, 14)
2044 .padding(1, 1)
2045 .kernel_size(3, 3)
2046 .groups(24)
2047 .iterations(3)
2048 .TestNHWCxF32();
2049 }
2050
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3_without_bias)2051 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3_without_bias) {
2052 ConvolutionOperatorTester()
2053 .has_bias(false)
2054 .input_size(15, 14)
2055 .padding(1, 1)
2056 .kernel_size(3, 3)
2057 .groups(24)
2058 .iterations(3)
2059 .TestNHWCxF32();
2060 }
2061
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s2)2062 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s2) {
2063 ConvolutionOperatorTester()
2064 .input_size(15, 14)
2065 .padding(1, 1)
2066 .kernel_size(3, 3)
2067 .subsampling(2)
2068 .groups(27)
2069 .iterations(3)
2070 .TestNHWCxF32();
2071 }
2072
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s2_with_tf_same_padding)2073 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s2_with_tf_same_padding) {
2074 for (size_t input_height = 14; input_height <= 15; input_height++) {
2075 for (size_t input_width = 14; input_width <= 15; input_width++) {
2076 ConvolutionOperatorTester()
2077 .input_size(input_height, input_width)
2078 .padding_tf_same(true)
2079 .kernel_size(3, 3)
2080 .subsampling(2)
2081 .groups(27)
2082 .iterations(3)
2083 .TestNHWCxF32();
2084 }
2085 }
2086 }
2087
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s1x2)2088 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s1x2) {
2089 ConvolutionOperatorTester()
2090 .input_size(15, 14)
2091 .padding(1, 1)
2092 .kernel_size(3, 3)
2093 .subsampling(1, 2)
2094 .groups(27)
2095 .iterations(3)
2096 .TestNHWCxF32();
2097 }
2098
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s1x2_with_tf_same_padding)2099 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s1x2_with_tf_same_padding) {
2100 for (size_t input_height = 14; input_height <= 15; input_height++) {
2101 for (size_t input_width = 14; input_width <= 15; input_width++) {
2102 ConvolutionOperatorTester()
2103 .input_size(input_height, input_width)
2104 .padding_tf_same(true)
2105 .kernel_size(3, 3)
2106 .subsampling(1, 2)
2107 .groups(27)
2108 .iterations(3)
2109 .TestNHWCxF32();
2110 }
2111 }
2112 }
2113
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s2x1)2114 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s2x1) {
2115 ConvolutionOperatorTester()
2116 .input_size(15, 14)
2117 .padding(1, 1)
2118 .kernel_size(3, 3)
2119 .subsampling(2, 1)
2120 .groups(27)
2121 .iterations(3)
2122 .TestNHWCxF32();
2123 }
2124
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3s2x1_with_tf_same_padding)2125 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3s2x1_with_tf_same_padding) {
2126 for (size_t input_height = 14; input_height <= 15; input_height++) {
2127 for (size_t input_width = 14; input_width <= 15; input_width++) {
2128 ConvolutionOperatorTester()
2129 .input_size(input_height, input_width)
2130 .padding_tf_same(true)
2131 .kernel_size(3, 3)
2132 .subsampling(2, 1)
2133 .groups(27)
2134 .iterations(3)
2135 .TestNHWCxF32();
2136 }
2137 }
2138 }
2139
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3d2)2140 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3d2) {
2141 ConvolutionOperatorTester()
2142 .input_size(15, 14)
2143 .padding(1, 1)
2144 .kernel_size(3, 3)
2145 .dilation(2)
2146 .groups(27)
2147 .iterations(3)
2148 .TestNHWCxF32();
2149 }
2150
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3d1x2)2151 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3d1x2) {
2152 ConvolutionOperatorTester()
2153 .input_size(15, 14)
2154 .padding(1, 1)
2155 .kernel_size(3, 3)
2156 .dilation(1, 2)
2157 .groups(27)
2158 .iterations(3)
2159 .TestNHWCxF32();
2160 }
2161
TEST(CONVOLUTION_NHWC_F32,depthwise_3x3d2x1)2162 TEST(CONVOLUTION_NHWC_F32, depthwise_3x3d2x1) {
2163 ConvolutionOperatorTester()
2164 .input_size(15, 14)
2165 .padding(1, 1)
2166 .kernel_size(3, 3)
2167 .dilation(2, 1)
2168 .groups(27)
2169 .iterations(3)
2170 .TestNHWCxF32();
2171 }
2172
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5)2173 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5) {
2174 ConvolutionOperatorTester()
2175 .input_size(15, 14)
2176 .padding(2, 2)
2177 .kernel_size(5, 5)
2178 .groups(27)
2179 .iterations(3)
2180 .TestNHWCxF32();
2181 }
2182
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5_without_bias)2183 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5_without_bias) {
2184 ConvolutionOperatorTester()
2185 .has_bias(false)
2186 .input_size(15, 14)
2187 .padding(2, 2)
2188 .kernel_size(5, 5)
2189 .groups(27)
2190 .iterations(3)
2191 .TestNHWCxF32();
2192 }
2193
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5s2)2194 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5s2) {
2195 ConvolutionOperatorTester()
2196 .input_size(15, 14)
2197 .padding(2, 2)
2198 .kernel_size(5, 5)
2199 .subsampling(2)
2200 .groups(27)
2201 .iterations(3)
2202 .TestNHWCxF32();
2203 }
2204
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5s1x2)2205 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5s1x2) {
2206 ConvolutionOperatorTester()
2207 .input_size(15, 14)
2208 .padding(2, 2)
2209 .kernel_size(5, 5)
2210 .subsampling(1, 2)
2211 .groups(27)
2212 .iterations(3)
2213 .TestNHWCxF32();
2214 }
2215
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5s2x1)2216 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5s2x1) {
2217 ConvolutionOperatorTester()
2218 .input_size(15, 14)
2219 .padding(2, 2)
2220 .kernel_size(5, 5)
2221 .subsampling(2, 1)
2222 .groups(27)
2223 .iterations(3)
2224 .TestNHWCxF32();
2225 }
2226
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5d2)2227 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5d2) {
2228 ConvolutionOperatorTester()
2229 .input_size(15, 14)
2230 .padding(2, 2)
2231 .kernel_size(5, 5)
2232 .dilation(2)
2233 .groups(27)
2234 .iterations(3)
2235 .TestNHWCxF32();
2236 }
2237
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5d1x2)2238 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5d1x2) {
2239 ConvolutionOperatorTester()
2240 .input_size(15, 14)
2241 .padding(2, 2)
2242 .kernel_size(5, 5)
2243 .dilation(1, 2)
2244 .groups(27)
2245 .iterations(3)
2246 .TestNHWCxF32();
2247 }
2248
TEST(CONVOLUTION_NHWC_F32,depthwise_5x5d2x1)2249 TEST(CONVOLUTION_NHWC_F32, depthwise_5x5d2x1) {
2250 ConvolutionOperatorTester()
2251 .input_size(15, 14)
2252 .padding(2, 2)
2253 .kernel_size(5, 5)
2254 .dilation(2, 1)
2255 .groups(27)
2256 .iterations(3)
2257 .TestNHWCxF32();
2258 }
2259
2260 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 1x1) {
2261 ConvolutionOperatorTester()
2262 .depthwise_layout(true)
2263 .input_size(15, 14)
2264 .kernel_size(1, 1)
2265 .groups(24)
2266 .iterations(3)
2267 .TestNHWCxF32();
2268 }
2269
2270 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 1x1_with_depth_multiplier) {
2271 ConvolutionOperatorTester()
2272 .depthwise_layout(true)
2273 .input_size(15, 14)
2274 .kernel_size(1, 1)
2275 .groups(24)
2276 .group_output_channels(3)
2277 .iterations(3)
2278 .TestNHWCxF32();
2279 }
2280
2281 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 1x1_without_bias) {
2282 ConvolutionOperatorTester()
2283 .depthwise_layout(true)
2284 .has_bias(false)
2285 .input_size(15, 14)
2286 .kernel_size(1, 1)
2287 .groups(24)
2288 .iterations(3)
2289 .TestNHWCxF32();
2290 }
2291
2292 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 2x2) {
2293 ConvolutionOperatorTester()
2294 .depthwise_layout(true)
2295 .input_size(15, 14)
2296 .padding(1, 1)
2297 .kernel_size(2, 2)
2298 .groups(24)
2299 .iterations(3)
2300 .TestNHWCxF32();
2301 }
2302
2303 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 2x2_with_depth_multiplier) {
2304 ConvolutionOperatorTester()
2305 .depthwise_layout(true)
2306 .input_size(15, 14)
2307 .padding(1, 1)
2308 .kernel_size(2, 2)
2309 .groups(24)
2310 .group_output_channels(3)
2311 .iterations(3)
2312 .TestNHWCxF32();
2313 }
2314
2315 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 2x2_without_bias) {
2316 ConvolutionOperatorTester()
2317 .depthwise_layout(true)
2318 .has_bias(false)
2319 .input_size(15, 14)
2320 .padding(1, 1)
2321 .kernel_size(2, 2)
2322 .groups(24)
2323 .iterations(3)
2324 .TestNHWCxF32();
2325 }
2326
2327 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 3x3) {
2328 ConvolutionOperatorTester()
2329 .depthwise_layout(true)
2330 .input_size(15, 14)
2331 .padding(1, 1)
2332 .kernel_size(3, 3)
2333 .groups(24)
2334 .iterations(3)
2335 .TestNHWCxF32();
2336 }
2337
2338 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 3x3_with_depth_multiplier) {
2339 ConvolutionOperatorTester()
2340 .depthwise_layout(true)
2341 .input_size(15, 14)
2342 .padding(1, 1)
2343 .kernel_size(3, 3)
2344 .groups(24)
2345 .group_output_channels(3)
2346 .iterations(3)
2347 .TestNHWCxF32();
2348 }
2349
2350 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 3x3_without_bias) {
2351 ConvolutionOperatorTester()
2352 .depthwise_layout(true)
2353 .has_bias(false)
2354 .input_size(15, 14)
2355 .padding(1, 1)
2356 .kernel_size(3, 3)
2357 .groups(24)
2358 .iterations(3)
2359 .TestNHWCxF32();
2360 }
2361
2362 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 3x3s2_with_tf_same_padding) {
2363 for (size_t input_height = 14; input_height <= 15; input_height++) {
2364 for (size_t input_width = 14; input_width <= 15; input_width++) {
2365 ConvolutionOperatorTester()
2366 .depthwise_layout(true)
2367 .input_size(input_height, input_width)
2368 .padding_tf_same(true)
2369 .kernel_size(3, 3)
2370 .groups(24)
2371 .iterations(3)
2372 .TestNHWCxF32();
2373 }
2374 }
2375 }
2376
2377 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 5x5) {
2378 ConvolutionOperatorTester()
2379 .depthwise_layout(true)
2380 .input_size(15, 14)
2381 .padding(2, 2)
2382 .kernel_size(5, 5)
2383 .groups(24)
2384 .iterations(3)
2385 .TestNHWCxF32();
2386 }
2387
2388 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 5x5_with_depth_multiplier) {
2389 ConvolutionOperatorTester()
2390 .depthwise_layout(true)
2391 .input_size(15, 14)
2392 .padding(2, 2)
2393 .kernel_size(5, 5)
2394 .groups(24)
2395 .group_output_channels(3)
2396 .iterations(3)
2397 .TestNHWCxF32();
2398 }
2399
2400 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 5x5_without_bias) {
2401 ConvolutionOperatorTester()
2402 .depthwise_layout(true)
2403 .has_bias(false)
2404 .input_size(15, 14)
2405 .padding(2, 2)
2406 .kernel_size(5, 5)
2407 .groups(24)
2408 .iterations(3)
2409 .TestNHWCxF32();
2410 }
2411
2412 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 7x7) {
2413 ConvolutionOperatorTester()
2414 .depthwise_layout(true)
2415 .input_size(15, 14)
2416 .padding(3, 3)
2417 .kernel_size(7, 7)
2418 .groups(24)
2419 .iterations(3)
2420 .TestNHWCxF32();
2421 }
2422
2423 TEST(DEPTHWISE_CONVOLUTION_NHWC_F32, 7x7_without_bias) {
2424 ConvolutionOperatorTester()
2425 .depthwise_layout(true)
2426 .has_bias(false)
2427 .input_size(15, 14)
2428 .padding(3, 3)
2429 .kernel_size(7, 7)
2430 .groups(24)
2431 .iterations(3)
2432 .TestNHWCxF32();
2433 }
2434
TEST(CONVOLUTION_NHWC_F32,setup_changing_input_buffer)2435 TEST(CONVOLUTION_NHWC_F32, setup_changing_input_buffer) {
2436 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2437 ConvolutionOperatorTester()
2438 .batch_size(3)
2439 .input_height(8)
2440 .input_width(8)
2441 .kernel_height(5)
2442 .kernel_width(3)
2443 .group_input_channels(15)
2444 .group_output_channels(17)
2445 .TestSetupNHWCxF32();
2446 }
2447
TEST(CONVOLUTION_NHWC_F32,setup_changing_input_buffer_grouped)2448 TEST(CONVOLUTION_NHWC_F32, setup_changing_input_buffer_grouped) {
2449 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2450 ConvolutionOperatorTester()
2451 .batch_size(3)
2452 .input_height(8)
2453 .input_width(8)
2454 .kernel_height(5)
2455 .kernel_width(3)
2456 .groups(2)
2457 .group_input_channels(15)
2458 .group_output_channels(17)
2459 .TestSetupNHWCxF32();
2460 }
2461
TEST(CONVOLUTION_NHWC_F32,setup_changing_input_buffer_depthwise)2462 TEST(CONVOLUTION_NHWC_F32, setup_changing_input_buffer_depthwise) {
2463 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2464 ConvolutionOperatorTester()
2465 .batch_size(3)
2466 .input_height(8)
2467 .input_width(8)
2468 .kernel_height(3)
2469 .kernel_width(3)
2470 .groups(19)
2471 .group_input_channels(1)
2472 .group_output_channels(1)
2473 .TestSetupNHWCxF32();
2474 }
2475
TEST(CONVOLUTION_NHWC_F32,setup_increasing_batch)2476 TEST(CONVOLUTION_NHWC_F32, setup_increasing_batch) {
2477 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2478 ConvolutionOperatorTester()
2479 .batch_size(3)
2480 .next_batch_size(5)
2481 .input_height(8)
2482 .input_width(8)
2483 .kernel_height(5)
2484 .kernel_width(3)
2485 .group_input_channels(15)
2486 .group_output_channels(17)
2487 .TestSetupNHWCxF32();
2488 }
2489
TEST(CONVOLUTION_NHWC_F32,setup_increasing_batch_grouped)2490 TEST(CONVOLUTION_NHWC_F32, setup_increasing_batch_grouped) {
2491 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2492 ConvolutionOperatorTester()
2493 .batch_size(3)
2494 .next_batch_size(5)
2495 .input_height(8)
2496 .input_width(8)
2497 .kernel_height(5)
2498 .kernel_width(3)
2499 .groups(2)
2500 .group_input_channels(15)
2501 .group_output_channels(17)
2502 .TestSetupNHWCxF32();
2503 }
2504
TEST(CONVOLUTION_NHWC_F32,setup_increasing_batch_depthwise)2505 TEST(CONVOLUTION_NHWC_F32, setup_increasing_batch_depthwise) {
2506 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2507 ConvolutionOperatorTester()
2508 .batch_size(3)
2509 .next_batch_size(5)
2510 .input_height(8)
2511 .input_width(8)
2512 .kernel_height(3)
2513 .kernel_width(3)
2514 .groups(19)
2515 .group_input_channels(1)
2516 .group_output_channels(1)
2517 .TestSetupNHWCxF32();
2518 }
2519
TEST(CONVOLUTION_NHWC_F32,setup_decreasing_batch)2520 TEST(CONVOLUTION_NHWC_F32, setup_decreasing_batch) {
2521 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2522 ConvolutionOperatorTester()
2523 .batch_size(5)
2524 .next_batch_size(3)
2525 .input_height(8)
2526 .input_width(8)
2527 .kernel_height(5)
2528 .kernel_width(3)
2529 .group_input_channels(15)
2530 .group_output_channels(17)
2531 .TestSetupNHWCxF32();
2532 }
2533
TEST(CONVOLUTION_NHWC_F32,setup_decreasing_batch_grouped)2534 TEST(CONVOLUTION_NHWC_F32, setup_decreasing_batch_grouped) {
2535 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2536 ConvolutionOperatorTester()
2537 .batch_size(5)
2538 .next_batch_size(3)
2539 .input_height(8)
2540 .input_width(8)
2541 .kernel_height(5)
2542 .kernel_width(3)
2543 .groups(2)
2544 .group_input_channels(15)
2545 .group_output_channels(17)
2546 .TestSetupNHWCxF32();
2547 }
2548
TEST(CONVOLUTION_NHWC_F32,setup_decreasing_batch_depthwise)2549 TEST(CONVOLUTION_NHWC_F32, setup_decreasing_batch_depthwise) {
2550 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2551 ConvolutionOperatorTester()
2552 .batch_size(5)
2553 .next_batch_size(3)
2554 .input_height(8)
2555 .input_width(8)
2556 .kernel_height(3)
2557 .kernel_width(3)
2558 .groups(19)
2559 .group_input_channels(1)
2560 .group_output_channels(1)
2561 .TestSetupNHWCxF32();
2562 }
2563
TEST(CONVOLUTION_NHWC_F32,setup_changing_height)2564 TEST(CONVOLUTION_NHWC_F32, setup_changing_height) {
2565 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2566 ConvolutionOperatorTester()
2567 .batch_size(3)
2568 .input_height(8)
2569 .input_width(8)
2570 .next_input_height(9)
2571 .kernel_height(5)
2572 .kernel_width(3)
2573 .group_input_channels(15)
2574 .group_output_channels(17)
2575 .TestSetupNHWCxF32();
2576 ConvolutionOperatorTester()
2577 .batch_size(3)
2578 .input_height(8)
2579 .input_width(8)
2580 .next_input_height(7)
2581 .kernel_height(5)
2582 .kernel_width(3)
2583 .group_input_channels(15)
2584 .group_output_channels(17)
2585 .TestSetupNHWCxF32();
2586 }
2587
TEST(CONVOLUTION_NHWC_F32,setup_changing_height_grouped)2588 TEST(CONVOLUTION_NHWC_F32, setup_changing_height_grouped) {
2589 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2590 ConvolutionOperatorTester()
2591 .batch_size(3)
2592 .input_height(8)
2593 .input_width(8)
2594 .next_input_height(9)
2595 .kernel_height(5)
2596 .kernel_width(3)
2597 .groups(2)
2598 .group_input_channels(15)
2599 .group_output_channels(17)
2600 .TestSetupNHWCxF32();
2601 ConvolutionOperatorTester()
2602 .batch_size(3)
2603 .input_height(8)
2604 .input_width(8)
2605 .next_input_height(7)
2606 .kernel_height(5)
2607 .kernel_width(3)
2608 .groups(2)
2609 .group_input_channels(15)
2610 .group_output_channels(17)
2611 .TestSetupNHWCxF32();
2612 }
2613
TEST(CONVOLUTION_NHWC_F32,setup_changing_height_depthwise)2614 TEST(CONVOLUTION_NHWC_F32, setup_changing_height_depthwise) {
2615 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2616 ConvolutionOperatorTester()
2617 .batch_size(3)
2618 .input_height(8)
2619 .input_width(8)
2620 .next_input_height(9)
2621 .kernel_height(3)
2622 .kernel_width(3)
2623 .groups(19)
2624 .group_input_channels(1)
2625 .group_output_channels(1)
2626 .TestSetupNHWCxF32();
2627 ConvolutionOperatorTester()
2628 .batch_size(3)
2629 .input_height(8)
2630 .input_width(8)
2631 .next_input_height(7)
2632 .kernel_height(3)
2633 .kernel_width(3)
2634 .groups(19)
2635 .group_input_channels(1)
2636 .group_output_channels(1)
2637 .TestSetupNHWCxF32();
2638 }
2639
TEST(CONVOLUTION_NHWC_F32,setup_changing_width)2640 TEST(CONVOLUTION_NHWC_F32, setup_changing_width) {
2641 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2642 ConvolutionOperatorTester()
2643 .batch_size(3)
2644 .input_height(8)
2645 .input_width(8)
2646 .next_input_width(9)
2647 .kernel_height(5)
2648 .kernel_width(3)
2649 .group_input_channels(15)
2650 .group_output_channels(17)
2651 .TestSetupNHWCxF32();
2652 ConvolutionOperatorTester()
2653 .batch_size(3)
2654 .input_height(8)
2655 .input_width(8)
2656 .next_input_width(7)
2657 .kernel_height(5)
2658 .kernel_width(3)
2659 .group_input_channels(15)
2660 .group_output_channels(17)
2661 .TestSetupNHWCxF32();
2662 }
2663
TEST(CONVOLUTION_NHWC_F32,setup_changing_width_grouped)2664 TEST(CONVOLUTION_NHWC_F32, setup_changing_width_grouped) {
2665 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2666 ConvolutionOperatorTester()
2667 .batch_size(3)
2668 .input_height(8)
2669 .input_width(8)
2670 .next_input_width(9)
2671 .kernel_height(5)
2672 .kernel_width(3)
2673 .groups(2)
2674 .group_input_channels(15)
2675 .group_output_channels(17)
2676 .TestSetupNHWCxF32();
2677 ConvolutionOperatorTester()
2678 .batch_size(3)
2679 .input_height(8)
2680 .input_width(8)
2681 .next_input_width(7)
2682 .kernel_height(5)
2683 .kernel_width(3)
2684 .groups(2)
2685 .group_input_channels(15)
2686 .group_output_channels(17)
2687 .TestSetupNHWCxF32();
2688 }
2689
TEST(CONVOLUTION_NHWC_F32,setup_changing_width_depthwise)2690 TEST(CONVOLUTION_NHWC_F32, setup_changing_width_depthwise) {
2691 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2692 ConvolutionOperatorTester()
2693 .batch_size(3)
2694 .input_height(8)
2695 .input_width(8)
2696 .next_input_width(9)
2697 .kernel_height(3)
2698 .kernel_width(3)
2699 .groups(19)
2700 .group_input_channels(1)
2701 .group_output_channels(1)
2702 .TestSetupNHWCxF32();
2703 ConvolutionOperatorTester()
2704 .batch_size(3)
2705 .input_height(8)
2706 .input_width(8)
2707 .next_input_width(7)
2708 .kernel_height(3)
2709 .kernel_width(3)
2710 .groups(19)
2711 .group_input_channels(1)
2712 .group_output_channels(1)
2713 .TestSetupNHWCxF32();
2714 }
2715
TEST(CONVOLUTION_NHWC_F32,setup_swap_height_and_width)2716 TEST(CONVOLUTION_NHWC_F32, setup_swap_height_and_width) {
2717 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2718 ConvolutionOperatorTester()
2719 .batch_size(3)
2720 .input_height(9)
2721 .input_width(8)
2722 .next_input_height(8)
2723 .next_input_width(9)
2724 .kernel_height(5)
2725 .kernel_width(3)
2726 .group_input_channels(15)
2727 .group_output_channels(17)
2728 .TestSetupNHWCxF32();
2729 }
2730
TEST(CONVOLUTION_NHWC_F32,setup_swap_height_and_width_grouped)2731 TEST(CONVOLUTION_NHWC_F32, setup_swap_height_and_width_grouped) {
2732 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2733 ConvolutionOperatorTester()
2734 .batch_size(3)
2735 .input_height(9)
2736 .input_width(8)
2737 .next_input_height(8)
2738 .next_input_width(9)
2739 .kernel_height(5)
2740 .kernel_width(3)
2741 .groups(2)
2742 .group_input_channels(15)
2743 .group_output_channels(17)
2744 .TestSetupNHWCxF32();
2745 }
2746
TEST(CONVOLUTION_NHWC_F32,setup_swap_height_and_width_depthwise)2747 TEST(CONVOLUTION_NHWC_F32, setup_swap_height_and_width_depthwise) {
2748 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2749 ConvolutionOperatorTester()
2750 .batch_size(3)
2751 .input_height(9)
2752 .input_width(8)
2753 .next_input_height(8)
2754 .next_input_width(9)
2755 .kernel_height(3)
2756 .kernel_width(3)
2757 .groups(19)
2758 .group_input_channels(1)
2759 .group_output_channels(1)
2760 .TestSetupNHWCxF32();
2761 }
2762