blob: 9ee89f43e0b4ee7e01b71e983fabcc5696e6b947 [file] [log] [blame]
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001/*
Michalis Spyrou80943252019-01-10 17:19:50 +00002 * Copyright (c) 2017-2019 ARM Limited.
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__
25#define __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__
26
27#include "arm_compute/core/TensorShape.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010028#include "tests/framework/datasets/Datasets.h"
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010029
30#include <type_traits>
31
32namespace arm_compute
33{
34namespace test
35{
36namespace datasets
37{
Gian Marco5420b282017-11-29 10:41:38 +000038/** Parent type for all for shape datasets. */
39using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>;
40
Michele Di Giorgio5daeffd2018-11-26 10:01:15 +000041/** Data set containing tiny 1D tensor shapes. */
42class Tiny1DShapes final : public ShapeDataset
43{
44public:
45 Tiny1DShapes()
46 : ShapeDataset("Shape",
47 {
48 TensorShape{ 2U },
49 TensorShape{ 3U },
50 })
51 {
52 }
53};
54
Gian Marco5420b282017-11-29 10:41:38 +000055/** Data set containing small 1D tensor shapes. */
56class Small1DShapes final : public ShapeDataset
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010057{
58public:
Gian Marco5420b282017-11-29 10:41:38 +000059 Small1DShapes()
60 : ShapeDataset("Shape",
61 {
Giorgio Arenae3d24ce2018-08-24 14:44:08 +010062 TensorShape{ 128U },
63 TensorShape{ 256U },
64 TensorShape{ 512U },
65 TensorShape{ 1024U }
Gian Marco5420b282017-11-29 10:41:38 +000066 })
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010067 {
68 }
69};
70
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +000071/** Data set containing tiny 2D tensor shapes. */
72class Tiny2DShapes final : public ShapeDataset
73{
74public:
75 Tiny2DShapes()
76 : ShapeDataset("Shape",
77 {
78 TensorShape{ 7U, 7U },
79 TensorShape{ 11U, 13U },
80 })
81 {
82 }
83};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +010084/** Data set containing small 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010085class Small2DShapes final : public ShapeDataset
86{
87public:
88 Small2DShapes()
89 : ShapeDataset("Shape",
90 {
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +010091 TensorShape{ 7U, 7U },
92 TensorShape{ 27U, 13U },
93 TensorShape{ 128U, 64U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010094 })
95 {
96 }
97};
98
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +000099/** Data set containing tiny 3D tensor shapes. */
100class Tiny3DShapes final : public ShapeDataset
101{
102public:
103 Tiny3DShapes()
104 : ShapeDataset("Shape",
105 {
106 TensorShape{ 7U, 7U, 5U },
107 TensorShape{ 23U, 13U, 9U },
108 })
109 {
110 }
111};
112
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100113/** Data set containing small 3D tensor shapes. */
114class Small3DShapes final : public ShapeDataset
115{
116public:
117 Small3DShapes()
118 : ShapeDataset("Shape",
119 {
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000120 TensorShape{ 1U, 7U, 7U },
Pablo Tello54303692018-11-22 16:14:36 +0000121 TensorShape{ 2U, 5U, 4U },
122
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000123 TensorShape{ 7U, 7U, 5U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100124 TensorShape{ 27U, 13U, 37U },
125 TensorShape{ 128U, 64U, 21U }
126 })
127 {
128 }
129};
130
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000131/** Data set containing tiny 4D tensor shapes. */
132class Tiny4DShapes final : public ShapeDataset
133{
134public:
135 Tiny4DShapes()
136 : ShapeDataset("Shape",
137 {
138 TensorShape{ 7U, 7U, 5U, 3U },
139 TensorShape{ 17U, 13U, 7U, 2U },
140 })
141 {
142 }
143};
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100144/** Data set containing small 4D tensor shapes. */
145class Small4DShapes final : public ShapeDataset
146{
147public:
148 Small4DShapes()
149 : ShapeDataset("Shape",
150 {
Manuel Bottini1d4f3852019-01-14 15:14:43 +0000151 TensorShape{ 2U, 7U, 1U, 3U },
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000152 TensorShape{ 7U, 7U, 5U, 3U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100153 TensorShape{ 27U, 13U, 37U, 2U },
154 TensorShape{ 128U, 64U, 21U, 3U }
155 })
156 {
157 }
158};
159
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100160/** Data set containing small tensor shapes. */
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000161class TinyShapes final : public ShapeDataset
162{
163public:
164 TinyShapes()
165 : ShapeDataset("Shape",
166 {
167 // Batch size 1
168 TensorShape{ 9U, 9U },
169 TensorShape{ 27U, 13U, 2U },
170 })
171 {
172 }
173};
174/** Data set containing small tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100175class SmallShapes final : public ShapeDataset
176{
177public:
178 SmallShapes()
179 : ShapeDataset("Shape",
180 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100181 // Batch size 1
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100182 TensorShape{ 11U, 11U },
Georgios Pinitas64f1a902018-09-18 13:42:51 +0100183 TensorShape{ 27U, 13U, 7U },
184 TensorShape{ 31U, 27U, 17U, 2U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100185 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100186 TensorShape{ 27U, 13U, 2U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100187 // Arbitrary batch size
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100188 TensorShape{ 11U, 11U, 3U, 5U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100189 })
190 {
191 }
192};
193
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000194/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
195class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
196{
197public:
198 SmallShapesBroadcast()
199 : ZipDataset<ShapeDataset, ShapeDataset>(
200 ShapeDataset("Shape0",
201 {
202 TensorShape{ 9U, 9U },
203 TensorShape{ 27U, 13U, 2U },
204 TensorShape{ 128U, 1U, 5U, 3U },
205 TensorShape{ 9U, 9U, 3U, 4U },
206 TensorShape{ 27U, 13U, 2U, 4U },
207 TensorShape{ 1U, 1U, 1U, 5U }
208 }),
209 ShapeDataset("Shape1",
210 {
211 TensorShape{ 9U, 1U, 2U },
212 TensorShape{ 1U, 13U, 2U },
213 TensorShape{ 128U, 64U, 1U, 3U },
214 TensorShape{ 9U, 1U, 3U },
215 TensorShape{ 1U },
216 TensorShape{ 9U, 9U, 3U, 5U }
217 }))
218 {
219 }
220};
221
steniu01f81652d2017-09-11 15:29:12 +0100222/** Data set containing medium tensor shapes. */
223class MediumShapes final : public ShapeDataset
224{
225public:
226 MediumShapes()
227 : ShapeDataset("Shape",
228 {
229 // Batch size 1
230 TensorShape{ 37U, 37U },
231 TensorShape{ 27U, 33U, 2U },
232 TensorShape{ 128U, 64U, 1U, 3U },
233 // Batch size 4
234 TensorShape{ 37U, 37U, 3U, 4U },
235 TensorShape{ 27U, 33U, 2U, 4U },
236 // Arbitrary batch size
237 TensorShape{ 37U, 37U, 3U, 5U }
238 })
239 {
240 }
241};
242
Gian Marco37908d92017-11-07 14:38:22 +0000243/** Data set containing medium 2D tensor shapes. */
244class Medium2DShapes final : public ShapeDataset
245{
246public:
247 Medium2DShapes()
248 : ShapeDataset("Shape",
249 {
250 TensorShape{ 42U, 37U },
251 TensorShape{ 57U, 60U },
252 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100253 TensorShape{ 83U, 72U },
254 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000255 })
256 {
257 }
258};
259
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000260/** Data set containing medium 3D tensor shapes. */
261class Medium3DShapes final : public ShapeDataset
262{
263public:
264 Medium3DShapes()
265 : ShapeDataset("Shape",
266 {
267 TensorShape{ 42U, 37U, 8U },
268 TensorShape{ 57U, 60U, 13U },
269 TensorShape{ 128U, 64U, 21U },
270 TensorShape{ 83U, 72U, 14U }
271 })
272 {
273 }
274};
275
276/** Data set containing medium 4D tensor shapes. */
277class Medium4DShapes final : public ShapeDataset
278{
279public:
280 Medium4DShapes()
281 : ShapeDataset("Shape",
282 {
283 TensorShape{ 42U, 37U, 8U, 15U },
284 TensorShape{ 57U, 60U, 13U, 8U },
285 TensorShape{ 128U, 64U, 21U, 13U },
286 TensorShape{ 83U, 72U, 14U, 5U }
287 })
288 {
289 }
290};
291
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100292/** Data set containing large tensor shapes. */
293class LargeShapes final : public ShapeDataset
294{
295public:
296 LargeShapes()
297 : ShapeDataset("Shape",
298 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100299 // Batch size 1
Gian Marco7f0f7902017-12-07 09:26:56 +0000300 TensorShape{ 1921U, 1083U },
301 TensorShape{ 641U, 485U, 2U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100302 // Batch size 4
Gian Marco7f0f7902017-12-07 09:26:56 +0000303 TensorShape{ 799U, 595U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100304 })
305 {
306 }
307};
308
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000309/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
310class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
311{
312public:
313 LargeShapesBroadcast()
314 : ZipDataset<ShapeDataset, ShapeDataset>(
315 ShapeDataset("Shape0",
316 {
317 TensorShape{ 1921U, 541U },
318 TensorShape{ 1U, 485U, 2U, 3U },
319 TensorShape{ 4159U, 1U },
320 TensorShape{ 799U }
321 }),
322 ShapeDataset("Shape1",
323 {
324 TensorShape{ 1921U, 1U, 2U },
325 TensorShape{ 641U, 1U, 2U, 3U },
326 TensorShape{ 1U, 127U, 25U },
327 TensorShape{ 799U, 595U, 1U, 4U }
328 }))
329 {
330 }
331};
332
Gian Marco5420b282017-11-29 10:41:38 +0000333/** Data set containing large 1D tensor shapes. */
334class Large1DShapes final : public ShapeDataset
335{
336public:
337 Large1DShapes()
338 : ShapeDataset("Shape",
339 {
340 TensorShape{ 1921U },
341 TensorShape{ 1245U },
342 TensorShape{ 4160U }
343 })
344 {
345 }
346};
347
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100348/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100349class Large2DShapes final : public ShapeDataset
350{
351public:
352 Large2DShapes()
353 : ShapeDataset("Shape",
354 {
355 TensorShape{ 1920U, 1080U },
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +0100356 TensorShape{ 1245U, 652U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100357 TensorShape{ 4160U, 3120U }
358 })
359 {
360 }
361};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100362
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100363/** Data set containing large 3D tensor shapes. */
364class Large3DShapes final : public ShapeDataset
365{
366public:
367 Large3DShapes()
368 : ShapeDataset("Shape",
369 {
370 TensorShape{ 320U, 240U, 3U },
371 TensorShape{ 383U, 653U, 2U },
372 TensorShape{ 721U, 123U, 13U }
373 })
374 {
375 }
376};
377
378/** Data set containing large 4D tensor shapes. */
379class Large4DShapes final : public ShapeDataset
380{
381public:
382 Large4DShapes()
383 : ShapeDataset("Shape",
384 {
385 TensorShape{ 320U, 123U, 3U, 3U },
386 TensorShape{ 383U, 413U, 2U, 3U },
387 TensorShape{ 517U, 123U, 13U, 2U }
388 })
389 {
390 }
391};
392
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000393/** Data set containing small 3x3 tensor shapes. */
394class Small3x3Shapes final : public ShapeDataset
395{
396public:
397 Small3x3Shapes()
398 : ShapeDataset("Shape",
399 {
400 TensorShape{ 3U, 3U, 7U, 4U },
401 TensorShape{ 3U, 3U, 4U, 13U },
402 TensorShape{ 3U, 3U, 9U, 2U },
403 TensorShape{ 3U, 3U, 3U, 5U },
404 })
405 {
406 }
407};
408
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100409/** Data set containing small 3x1 tensor shapes. */
410class Small3x1Shapes final : public ShapeDataset
411{
412public:
413 Small3x1Shapes()
414 : ShapeDataset("Shape",
415 {
416 TensorShape{ 3U, 1U, 7U, 4U },
417 TensorShape{ 3U, 1U, 4U, 13U },
418 TensorShape{ 3U, 1U, 9U, 2U },
419 TensorShape{ 3U, 1U, 3U, 5U },
420 })
421 {
422 }
423};
424
425/** Data set containing small 1x3 tensor shapes. */
426class Small1x3Shapes final : public ShapeDataset
427{
428public:
429 Small1x3Shapes()
430 : ShapeDataset("Shape",
431 {
432 TensorShape{ 1U, 3U, 7U, 4U },
433 TensorShape{ 1U, 3U, 4U, 13U },
434 TensorShape{ 1U, 3U, 9U, 2U },
435 TensorShape{ 1U, 3U, 3U, 5U },
436 })
437 {
438 }
439};
440
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000441/** Data set containing large 3x3 tensor shapes. */
442class Large3x3Shapes final : public ShapeDataset
443{
444public:
445 Large3x3Shapes()
446 : ShapeDataset("Shape",
447 {
448 TensorShape{ 3U, 3U, 32U, 64U },
449 TensorShape{ 3U, 3U, 51U, 13U },
450 TensorShape{ 3U, 3U, 53U, 47U },
451 TensorShape{ 3U, 3U, 128U, 384U },
452 })
453 {
454 }
455};
456
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100457/** Data set containing large 3x1 tensor shapes. */
458class Large3x1Shapes final : public ShapeDataset
459{
460public:
461 Large3x1Shapes()
462 : ShapeDataset("Shape",
463 {
464 TensorShape{ 3U, 1U, 32U, 64U },
465 TensorShape{ 3U, 1U, 51U, 13U },
466 TensorShape{ 3U, 1U, 53U, 47U },
467 TensorShape{ 3U, 1U, 128U, 384U },
468 })
469 {
470 }
471};
472
473/** Data set containing large 1x3 tensor shapes. */
474class Large1x3Shapes final : public ShapeDataset
475{
476public:
477 Large1x3Shapes()
478 : ShapeDataset("Shape",
479 {
480 TensorShape{ 1U, 3U, 32U, 64U },
481 TensorShape{ 1U, 3U, 51U, 13U },
482 TensorShape{ 1U, 3U, 53U, 47U },
483 TensorShape{ 1U, 3U, 128U, 384U },
484 })
485 {
486 }
487};
488
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100489/** Data set containing small 5x5 tensor shapes. */
490class Small5x5Shapes final : public ShapeDataset
491{
492public:
493 Small5x5Shapes()
494 : ShapeDataset("Shape",
495 {
496 TensorShape{ 5U, 5U, 7U, 4U },
497 TensorShape{ 5U, 5U, 4U, 13U },
498 TensorShape{ 5U, 5U, 9U, 2U },
499 TensorShape{ 5U, 5U, 3U, 5U },
500 })
501 {
502 }
503};
504
505/** Data set containing large 5x5 tensor shapes. */
506class Large5x5Shapes final : public ShapeDataset
507{
508public:
509 Large5x5Shapes()
510 : ShapeDataset("Shape",
511 {
512 TensorShape{ 5U, 5U, 32U, 64U },
513 TensorShape{ 5U, 5U, 51U, 13U },
514 TensorShape{ 5U, 5U, 53U, 47U },
515 TensorShape{ 5U, 5U, 128U, 384U },
516 })
517 {
518 }
519};
520
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100521/** Data set containing small 5x1 tensor shapes. */
522class Small5x1Shapes final : public ShapeDataset
523{
524public:
525 Small5x1Shapes()
526 : ShapeDataset("Shape",
527 {
528 TensorShape{ 5U, 1U, 7U, 4U },
529 TensorShape{ 5U, 1U, 4U, 13U },
530 TensorShape{ 5U, 1U, 9U, 2U },
531 TensorShape{ 5U, 1U, 3U, 5U },
532 })
533 {
534 }
535};
536
537/** Data set containing large 5x1 tensor shapes. */
538class Large5x1Shapes final : public ShapeDataset
539{
540public:
541 Large5x1Shapes()
542 : ShapeDataset("Shape",
543 {
544 TensorShape{ 5U, 1U, 32U, 64U },
545 TensorShape{ 5U, 1U, 51U, 13U },
546 TensorShape{ 5U, 1U, 53U, 47U },
547 TensorShape{ 5U, 1U, 128U, 384U },
548 })
549 {
550 }
551};
552
553/** Data set containing small 1x5 tensor shapes. */
554class Small1x5Shapes final : public ShapeDataset
555{
556public:
557 Small1x5Shapes()
558 : ShapeDataset("Shape",
559 {
560 TensorShape{ 1U, 5U, 7U, 4U },
561 TensorShape{ 1U, 5U, 4U, 13U },
562 TensorShape{ 1U, 5U, 9U, 2U },
563 TensorShape{ 1U, 5U, 3U, 5U },
564 })
565 {
566 }
567};
568
569/** Data set containing large 1x5 tensor shapes. */
570class Large1x5Shapes final : public ShapeDataset
571{
572public:
573 Large1x5Shapes()
574 : ShapeDataset("Shape",
575 {
576 TensorShape{ 1U, 5U, 32U, 64U },
577 TensorShape{ 1U, 5U, 51U, 13U },
578 TensorShape{ 1U, 5U, 53U, 47U },
579 TensorShape{ 1U, 5U, 128U, 384U },
580 })
581 {
582 }
583};
584
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100585/** Data set containing small tensor shapes for deconvolution. */
586class SmallDeconvolutionShapes final : public ShapeDataset
587{
588public:
589 SmallDeconvolutionShapes()
590 : ShapeDataset("InputShape",
591 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000592 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100593 TensorShape{ 5U, 5U, 3U },
594 TensorShape{ 11U, 13U, 4U, 3U }
595 })
596 {
597 }
598};
599
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000600/** Data set containing tiny tensor shapes for direct convolution. */
601class TinyDirectConvolutionShapes final : public ShapeDataset
602{
603public:
604 TinyDirectConvolutionShapes()
605 : ShapeDataset("InputShape",
606 {
607 // Batch size 1
608 TensorShape{ 11U, 13U, 3U },
609 TensorShape{ 7U, 27U, 3U }
610 })
611 {
612 }
613};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100614/** Data set containing small tensor shapes for direct convolution. */
615class SmallDirectConvolutionShapes final : public ShapeDataset
616{
617public:
618 SmallDirectConvolutionShapes()
619 : ShapeDataset("InputShape",
620 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100621 // Batch size 1
steniu01f81652d2017-09-11 15:29:12 +0100622 TensorShape{ 35U, 35U, 3U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100623 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100624 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100625 TensorShape{ 32U, 37U, 3U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100626 // Batch size 8
SiCong Licaf8c5e2017-08-21 13:12:52 +0100627 TensorShape{ 32U, 37U, 3U, 8U },
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000628 TensorShape{ 33U, 35U, 8U, 8U }
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100629 })
630 {
631 }
632};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100633
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800634/** Data set containing small tensor shapes for direct convolution. */
635class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
636{
637public:
638 SmallDirectConvolutionTensorShiftShapes()
639 : ShapeDataset("InputShape",
640 {
641 // Batch size 1
642 TensorShape{ 35U, 35U, 3U },
643 TensorShape{ 32U, 37U, 3U },
644 // Batch size 4
645 TensorShape{ 32U, 37U, 3U, 4U },
646 // Batch size 8
647 TensorShape{ 32U, 37U, 3U, 8U },
648 TensorShape{ 33U, 35U, 3U, 8U },
649 // Arbitrary batch size
650 TensorShape{ 32U, 37U, 3U, 8U }
651 })
652 {
653 }
654};
655
Giorgio Arena0f170392018-07-18 16:13:12 +0100656/** Data set containing small grouped im2col tensor shapes. */
657class GroupedIm2ColSmallShapes final : public ShapeDataset
658{
659public:
660 GroupedIm2ColSmallShapes()
661 : ShapeDataset("Shape",
662 {
663 TensorShape{ 11U, 11U, 48U },
664 TensorShape{ 27U, 13U, 24U },
665 TensorShape{ 128U, 64U, 12U, 3U },
666 TensorShape{ 11U, 11U, 48U, 4U },
667 TensorShape{ 27U, 13U, 24U, 4U },
668 TensorShape{ 11U, 11U, 48U, 5U }
669 })
670 {
671 }
672};
673
674/** Data set containing large grouped im2col tensor shapes. */
675class GroupedIm2ColLargeShapes final : public ShapeDataset
676{
677public:
678 GroupedIm2ColLargeShapes()
679 : ShapeDataset("Shape",
680 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100681 TensorShape{ 153U, 231U, 12U },
682 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100683 })
684 {
685 }
686};
687
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100688/** Data set containing small grouped weights tensor shapes. */
689class GroupedWeightsSmallShapes final : public ShapeDataset
690{
691public:
692 GroupedWeightsSmallShapes()
693 : ShapeDataset("Shape",
694 {
695 TensorShape{ 3U, 3U, 48U, 120U },
696 TensorShape{ 1U, 3U, 24U, 240U },
697 TensorShape{ 3U, 1U, 12U, 480U },
698 TensorShape{ 5U, 5U, 48U, 120U },
699 TensorShape{ 1U, 5U, 24U, 240U },
700 TensorShape{ 5U, 1U, 48U, 480U }
701 })
702 {
703 }
704};
705
706/** Data set containing large grouped weights tensor shapes. */
707class GroupedWeightsLargeShapes final : public ShapeDataset
708{
709public:
710 GroupedWeightsLargeShapes()
711 : ShapeDataset("Shape",
712 {
713 TensorShape{ 9U, 9U, 96U, 240U },
714 TensorShape{ 7U, 9U, 48U, 480U },
715 TensorShape{ 9U, 7U, 24U, 960U },
716 TensorShape{ 13U, 13U, 96U, 240U },
717 TensorShape{ 11U, 13U, 48U, 480U },
718 TensorShape{ 13U, 11U, 24U, 960U }
719 })
720 {
721 }
722};
723
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000724/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
725class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100726{
727public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000728 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100729 : ShapeDataset("Shape",
730 {
731 TensorShape{ 322U, 243U },
732 TensorShape{ 463U, 879U },
733 TensorShape{ 416U, 651U }
734 })
735 {
736 }
737};
738
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100739/** Data set containing tensor shapes for WidthConcatenateLayer. */
740class WidthConcatenateLayerShapes final : public ShapeDataset
741{
742public:
743 WidthConcatenateLayerShapes()
744 : ShapeDataset("Shape",
745 {
746 TensorShape{ 232U, 65U, 3U },
747 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100748 TensorShape{ 124U, 65U, 3U },
749 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100750 })
751 {
752 }
753};
754
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100755/** Data set containing global pooling tensor shapes. */
756class GlobalPoolingShapes final : public ShapeDataset
757{
758public:
759 GlobalPoolingShapes()
760 : ShapeDataset("Shape",
761 {
762 // Batch size 1
763 TensorShape{ 9U, 9U },
764 TensorShape{ 13U, 13U, 2U },
765 TensorShape{ 27U, 27U, 1U, 3U },
766 // Batch size 4
767 TensorShape{ 31U, 31U, 3U, 4U },
768 TensorShape{ 34U, 34U, 2U, 4U }
769 })
770 {
771 }
772};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000773/** Data set containing tiny softmax layer shapes. */
774class SoftmaxLayerTinyShapes final : public ShapeDataset
775{
776public:
777 SoftmaxLayerTinyShapes()
778 : ShapeDataset("Shape",
779 {
780 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100781 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000782 })
783 {
784 }
785};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100786
Chunosovd6afedc2017-11-06 22:09:45 +0700787/** Data set containing small softmax layer shapes. */
788class SoftmaxLayerSmallShapes final : public ShapeDataset
789{
790public:
791 SoftmaxLayerSmallShapes()
792 : ShapeDataset("Shape",
793 {
794 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100795 TensorShape{ 256U, 10U },
796 TensorShape{ 353U, 8U },
797 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700798 })
799 {
800 }
801};
802
803/** Data set containing large softmax layer shapes. */
804class SoftmaxLayerLargeShapes final : public ShapeDataset
805{
806public:
807 SoftmaxLayerLargeShapes()
808 : ShapeDataset("Shape",
809 {
810 TensorShape{ 1000U, 10U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100811 TensorShape{ 3989U, 10U },
Chunosovd6afedc2017-11-06 22:09:45 +0700812 TensorShape{ 7339U, 11U },
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100813
814 })
815 {
816 }
817};
818
819/** Data set containing large and small softmax layer 4D shapes. */
820class SoftmaxLayer4DShapes final : public ShapeDataset
821{
822public:
823 SoftmaxLayer4DShapes()
824 : ShapeDataset("Shape",
825 {
826 TensorShape{ 9U, 9U, 9U, 9U },
827 TensorShape{ 256U, 10U, 1U, 9U },
828 TensorShape{ 353U, 8U, 2U },
829 TensorShape{ 781U, 5U, 2U, 2U },
830 TensorShape{ 781U, 11U, 1U, 2U },
Chunosovd6afedc2017-11-06 22:09:45 +0700831 })
832 {
833 }
834};
835
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000836/** Data set containing 2D tensor shapes relative to an image size. */
837class SmallImageShapes final : public ShapeDataset
838{
839public:
840 SmallImageShapes()
841 : ShapeDataset("Shape",
842 {
843 TensorShape{ 640U, 480U },
844 TensorShape{ 800U, 600U },
845 TensorShape{ 1200U, 800U }
846 })
847 {
848 }
849};
850
851/** Data set containing 2D tensor shapes relative to an image size. */
852class LargeImageShapes final : public ShapeDataset
853{
854public:
855 LargeImageShapes()
856 : ShapeDataset("Shape",
857 {
858 TensorShape{ 1920U, 1080U },
859 TensorShape{ 2560U, 1536U },
860 TensorShape{ 3584U, 2048U }
861 })
862 {
863 }
864};
Giorgio Arena73023022018-09-04 14:55:55 +0100865
866/** Data set containing small YOLO tensor shapes. */
867class SmallYOLOShapes final : public ShapeDataset
868{
869public:
870 SmallYOLOShapes()
871 : ShapeDataset("Shape",
872 {
873 // Batch size 1
874 TensorShape{ 11U, 11U, 270U },
875 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100876 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100877 })
878 {
879 }
880};
881
882/** Data set containing large YOLO tensor shapes. */
883class LargeYOLOShapes final : public ShapeDataset
884{
885public:
886 LargeYOLOShapes()
887 : ShapeDataset("Shape",
888 {
889 TensorShape{ 24U, 23U, 270U },
890 TensorShape{ 51U, 63U, 90U, 2U },
891 TensorShape{ 76U, 91U, 45U, 3U }
892 })
893 {
894 }
895};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000896
897/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
898class SmallGEMMReshape2DShapes final : public ShapeDataset
899{
900public:
901 SmallGEMMReshape2DShapes()
902 : ShapeDataset("Shape",
903 {
904 TensorShape{ 63U, 72U },
905 })
906 {
907 }
908};
909
910/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
911class SmallGEMMReshape3DShapes final : public ShapeDataset
912{
913public:
914 SmallGEMMReshape3DShapes()
915 : ShapeDataset("Shape",
916 {
917 TensorShape{ 63U, 9U, 8U },
918 })
919 {
920 }
921};
922
923/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
924class LargeGEMMReshape2DShapes final : public ShapeDataset
925{
926public:
927 LargeGEMMReshape2DShapes()
928 : ShapeDataset("Shape",
929 {
930 TensorShape{ 16U, 27U },
931 TensorShape{ 533U, 171U },
932 TensorShape{ 345U, 612U }
933 })
934 {
935 }
936};
937
938/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
939class LargeGEMMReshape3DShapes final : public ShapeDataset
940{
941public:
942 LargeGEMMReshape3DShapes()
943 : ShapeDataset("Shape",
944 {
945 TensorShape{ 16U, 3U, 9U },
946 TensorShape{ 533U, 19U, 9U },
947 TensorShape{ 345U, 34U, 18U }
948 })
949 {
950 }
951};
Pablo Telloa0a0e292018-12-21 16:47:23 +0000952
953/** Data set containing small 2D tensor shapes. */
954class Small2DNonMaxSuppressionShapes final : public ShapeDataset
955{
956public:
957 Small2DNonMaxSuppressionShapes()
958 : ShapeDataset("Shape",
959 {
960 TensorShape{ 4U, 7U },
961 TensorShape{ 4U, 13U },
962 TensorShape{ 4U, 64U }
963 })
964 {
965 }
966};
967
968/** Data set containing large 2D tensor shapes. */
969class Large2DNonMaxSuppressionShapes final : public ShapeDataset
970{
971public:
972 Large2DNonMaxSuppressionShapes()
973 : ShapeDataset("Shape",
974 {
975 TensorShape{ 4U, 207U },
976 TensorShape{ 4U, 113U },
977 TensorShape{ 4U, 264U }
978 })
979 {
980 }
981};
982
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100983} // namespace datasets
984} // namespace test
985} // namespace arm_compute
986#endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */