blob: 07ecf45d811ee776a489c97279296cb29e23a052 [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 },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100125 })
126 {
127 }
128};
129
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000130/** Data set containing tiny 4D tensor shapes. */
131class Tiny4DShapes final : public ShapeDataset
132{
133public:
134 Tiny4DShapes()
135 : ShapeDataset("Shape",
136 {
137 TensorShape{ 7U, 7U, 5U, 3U },
138 TensorShape{ 17U, 13U, 7U, 2U },
139 })
140 {
141 }
142};
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100143/** Data set containing small 4D tensor shapes. */
144class Small4DShapes final : public ShapeDataset
145{
146public:
147 Small4DShapes()
148 : ShapeDataset("Shape",
149 {
Manuel Bottini1d4f3852019-01-14 15:14:43 +0000150 TensorShape{ 2U, 7U, 1U, 3U },
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000151 TensorShape{ 7U, 7U, 5U, 3U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100152 TensorShape{ 27U, 13U, 37U, 2U },
153 TensorShape{ 128U, 64U, 21U, 3U }
154 })
155 {
156 }
157};
158
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100159/** Data set containing small tensor shapes. */
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000160class TinyShapes final : public ShapeDataset
161{
162public:
163 TinyShapes()
164 : ShapeDataset("Shape",
165 {
166 // Batch size 1
167 TensorShape{ 9U, 9U },
168 TensorShape{ 27U, 13U, 2U },
169 })
170 {
171 }
172};
173/** Data set containing small tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100174class SmallShapes final : public ShapeDataset
175{
176public:
177 SmallShapes()
178 : ShapeDataset("Shape",
179 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100180 // Batch size 1
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100181 TensorShape{ 11U, 11U },
Georgios Pinitas64f1a902018-09-18 13:42:51 +0100182 TensorShape{ 27U, 13U, 7U },
183 TensorShape{ 31U, 27U, 17U, 2U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100184 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100185 TensorShape{ 27U, 13U, 2U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100186 // Arbitrary batch size
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100187 TensorShape{ 11U, 11U, 3U, 5U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100188 })
189 {
190 }
191};
192
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000193/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
194class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
195{
196public:
197 SmallShapesBroadcast()
198 : ZipDataset<ShapeDataset, ShapeDataset>(
199 ShapeDataset("Shape0",
200 {
201 TensorShape{ 9U, 9U },
202 TensorShape{ 27U, 13U, 2U },
203 TensorShape{ 128U, 1U, 5U, 3U },
204 TensorShape{ 9U, 9U, 3U, 4U },
205 TensorShape{ 27U, 13U, 2U, 4U },
206 TensorShape{ 1U, 1U, 1U, 5U }
207 }),
208 ShapeDataset("Shape1",
209 {
210 TensorShape{ 9U, 1U, 2U },
211 TensorShape{ 1U, 13U, 2U },
212 TensorShape{ 128U, 64U, 1U, 3U },
213 TensorShape{ 9U, 1U, 3U },
214 TensorShape{ 1U },
215 TensorShape{ 9U, 9U, 3U, 5U }
216 }))
217 {
218 }
219};
220
steniu01f81652d2017-09-11 15:29:12 +0100221/** Data set containing medium tensor shapes. */
222class MediumShapes final : public ShapeDataset
223{
224public:
225 MediumShapes()
226 : ShapeDataset("Shape",
227 {
228 // Batch size 1
229 TensorShape{ 37U, 37U },
230 TensorShape{ 27U, 33U, 2U },
steniu01f81652d2017-09-11 15:29:12 +0100231 // Arbitrary batch size
232 TensorShape{ 37U, 37U, 3U, 5U }
233 })
234 {
235 }
236};
237
Gian Marco37908d92017-11-07 14:38:22 +0000238/** Data set containing medium 2D tensor shapes. */
239class Medium2DShapes final : public ShapeDataset
240{
241public:
242 Medium2DShapes()
243 : ShapeDataset("Shape",
244 {
245 TensorShape{ 42U, 37U },
246 TensorShape{ 57U, 60U },
247 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100248 TensorShape{ 83U, 72U },
249 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000250 })
251 {
252 }
253};
254
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000255/** Data set containing medium 3D tensor shapes. */
256class Medium3DShapes final : public ShapeDataset
257{
258public:
259 Medium3DShapes()
260 : ShapeDataset("Shape",
261 {
262 TensorShape{ 42U, 37U, 8U },
263 TensorShape{ 57U, 60U, 13U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000264 TensorShape{ 83U, 72U, 14U }
265 })
266 {
267 }
268};
269
270/** Data set containing medium 4D tensor shapes. */
271class Medium4DShapes final : public ShapeDataset
272{
273public:
274 Medium4DShapes()
275 : ShapeDataset("Shape",
276 {
277 TensorShape{ 42U, 37U, 8U, 15U },
278 TensorShape{ 57U, 60U, 13U, 8U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000279 TensorShape{ 83U, 72U, 14U, 5U }
280 })
281 {
282 }
283};
284
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100285/** Data set containing large tensor shapes. */
286class LargeShapes final : public ShapeDataset
287{
288public:
289 LargeShapes()
290 : ShapeDataset("Shape",
291 {
Michalis Spyrou97b2bb12019-05-28 16:59:27 +0100292 TensorShape{ 582U, 131U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100293 })
294 {
295 }
296};
297
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000298/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
299class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
300{
301public:
302 LargeShapesBroadcast()
303 : ZipDataset<ShapeDataset, ShapeDataset>(
304 ShapeDataset("Shape0",
305 {
306 TensorShape{ 1921U, 541U },
307 TensorShape{ 1U, 485U, 2U, 3U },
308 TensorShape{ 4159U, 1U },
309 TensorShape{ 799U }
310 }),
311 ShapeDataset("Shape1",
312 {
313 TensorShape{ 1921U, 1U, 2U },
314 TensorShape{ 641U, 1U, 2U, 3U },
315 TensorShape{ 1U, 127U, 25U },
316 TensorShape{ 799U, 595U, 1U, 4U }
317 }))
318 {
319 }
320};
321
Gian Marco5420b282017-11-29 10:41:38 +0000322/** Data set containing large 1D tensor shapes. */
323class Large1DShapes final : public ShapeDataset
324{
325public:
326 Large1DShapes()
327 : ShapeDataset("Shape",
328 {
329 TensorShape{ 1921U },
330 TensorShape{ 1245U },
331 TensorShape{ 4160U }
332 })
333 {
334 }
335};
336
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100337/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100338class Large2DShapes final : public ShapeDataset
339{
340public:
341 Large2DShapes()
342 : ShapeDataset("Shape",
343 {
344 TensorShape{ 1920U, 1080U },
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +0100345 TensorShape{ 1245U, 652U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100346 TensorShape{ 4160U, 3120U }
347 })
348 {
349 }
350};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100351
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100352/** Data set containing large 3D tensor shapes. */
353class Large3DShapes final : public ShapeDataset
354{
355public:
356 Large3DShapes()
357 : ShapeDataset("Shape",
358 {
359 TensorShape{ 320U, 240U, 3U },
360 TensorShape{ 383U, 653U, 2U },
361 TensorShape{ 721U, 123U, 13U }
362 })
363 {
364 }
365};
366
367/** Data set containing large 4D tensor shapes. */
368class Large4DShapes final : public ShapeDataset
369{
370public:
371 Large4DShapes()
372 : ShapeDataset("Shape",
373 {
374 TensorShape{ 320U, 123U, 3U, 3U },
375 TensorShape{ 383U, 413U, 2U, 3U },
376 TensorShape{ 517U, 123U, 13U, 2U }
377 })
378 {
379 }
380};
381
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000382/** Data set containing small 3x3 tensor shapes. */
383class Small3x3Shapes final : public ShapeDataset
384{
385public:
386 Small3x3Shapes()
387 : ShapeDataset("Shape",
388 {
389 TensorShape{ 3U, 3U, 7U, 4U },
390 TensorShape{ 3U, 3U, 4U, 13U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000391 TensorShape{ 3U, 3U, 3U, 5U },
392 })
393 {
394 }
395};
396
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100397/** Data set containing small 3x1 tensor shapes. */
398class Small3x1Shapes final : public ShapeDataset
399{
400public:
401 Small3x1Shapes()
402 : ShapeDataset("Shape",
403 {
404 TensorShape{ 3U, 1U, 7U, 4U },
405 TensorShape{ 3U, 1U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100406 TensorShape{ 3U, 1U, 3U, 5U },
407 })
408 {
409 }
410};
411
412/** Data set containing small 1x3 tensor shapes. */
413class Small1x3Shapes final : public ShapeDataset
414{
415public:
416 Small1x3Shapes()
417 : ShapeDataset("Shape",
418 {
419 TensorShape{ 1U, 3U, 7U, 4U },
420 TensorShape{ 1U, 3U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100421 TensorShape{ 1U, 3U, 3U, 5U },
422 })
423 {
424 }
425};
426
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000427/** Data set containing large 3x3 tensor shapes. */
428class Large3x3Shapes final : public ShapeDataset
429{
430public:
431 Large3x3Shapes()
432 : ShapeDataset("Shape",
433 {
434 TensorShape{ 3U, 3U, 32U, 64U },
435 TensorShape{ 3U, 3U, 51U, 13U },
436 TensorShape{ 3U, 3U, 53U, 47U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000437 })
438 {
439 }
440};
441
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100442/** Data set containing large 3x1 tensor shapes. */
443class Large3x1Shapes final : public ShapeDataset
444{
445public:
446 Large3x1Shapes()
447 : ShapeDataset("Shape",
448 {
449 TensorShape{ 3U, 1U, 32U, 64U },
450 TensorShape{ 3U, 1U, 51U, 13U },
451 TensorShape{ 3U, 1U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100452 })
453 {
454 }
455};
456
457/** Data set containing large 1x3 tensor shapes. */
458class Large1x3Shapes final : public ShapeDataset
459{
460public:
461 Large1x3Shapes()
462 : ShapeDataset("Shape",
463 {
464 TensorShape{ 1U, 3U, 32U, 64U },
465 TensorShape{ 1U, 3U, 51U, 13U },
466 TensorShape{ 1U, 3U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100467 })
468 {
469 }
470};
471
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100472/** Data set containing small 5x5 tensor shapes. */
473class Small5x5Shapes final : public ShapeDataset
474{
475public:
476 Small5x5Shapes()
477 : ShapeDataset("Shape",
478 {
479 TensorShape{ 5U, 5U, 7U, 4U },
480 TensorShape{ 5U, 5U, 4U, 13U },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100481 TensorShape{ 5U, 5U, 3U, 5U },
482 })
483 {
484 }
485};
486
487/** Data set containing large 5x5 tensor shapes. */
488class Large5x5Shapes final : public ShapeDataset
489{
490public:
491 Large5x5Shapes()
492 : ShapeDataset("Shape",
493 {
494 TensorShape{ 5U, 5U, 32U, 64U },
495 TensorShape{ 5U, 5U, 51U, 13U },
496 TensorShape{ 5U, 5U, 53U, 47U },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100497 })
498 {
499 }
500};
501
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100502/** Data set containing small 5x1 tensor shapes. */
503class Small5x1Shapes final : public ShapeDataset
504{
505public:
506 Small5x1Shapes()
507 : ShapeDataset("Shape",
508 {
509 TensorShape{ 5U, 1U, 7U, 4U },
510 TensorShape{ 5U, 1U, 4U, 13U },
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100511 TensorShape{ 5U, 1U, 3U, 5U },
512 })
513 {
514 }
515};
516
517/** Data set containing large 5x1 tensor shapes. */
518class Large5x1Shapes final : public ShapeDataset
519{
520public:
521 Large5x1Shapes()
522 : ShapeDataset("Shape",
523 {
524 TensorShape{ 5U, 1U, 32U, 64U },
525 TensorShape{ 5U, 1U, 51U, 13U },
526 TensorShape{ 5U, 1U, 53U, 47U },
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100527 })
528 {
529 }
530};
531
532/** Data set containing small 1x5 tensor shapes. */
533class Small1x5Shapes final : public ShapeDataset
534{
535public:
536 Small1x5Shapes()
537 : ShapeDataset("Shape",
538 {
539 TensorShape{ 1U, 5U, 7U, 4U },
540 TensorShape{ 1U, 5U, 4U, 13U },
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100541 TensorShape{ 1U, 5U, 3U, 5U },
542 })
543 {
544 }
545};
546
547/** Data set containing large 1x5 tensor shapes. */
548class Large1x5Shapes final : public ShapeDataset
549{
550public:
551 Large1x5Shapes()
552 : ShapeDataset("Shape",
553 {
554 TensorShape{ 1U, 5U, 32U, 64U },
555 TensorShape{ 1U, 5U, 51U, 13U },
556 TensorShape{ 1U, 5U, 53U, 47U },
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100557 })
558 {
559 }
560};
561
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000562/** Data set containing small 1x7 tensor shapes. */
563class Small1x7Shapes final : public ShapeDataset
564{
565public:
566 Small1x7Shapes()
567 : ShapeDataset("Shape",
568 {
569 TensorShape{ 1U, 7U, 7U, 4U },
570 TensorShape{ 1U, 7U, 4U, 13U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000571 TensorShape{ 1U, 7U, 3U, 5U },
572 })
573 {
574 }
575};
576
577/** Data set containing large 1x7 tensor shapes. */
578class Large1x7Shapes final : public ShapeDataset
579{
580public:
581 Large1x7Shapes()
582 : ShapeDataset("Shape",
583 {
584 TensorShape{ 1U, 7U, 32U, 64U },
585 TensorShape{ 1U, 7U, 51U, 13U },
586 TensorShape{ 1U, 7U, 53U, 47U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000587 })
588 {
589 }
590};
591
592/** Data set containing small 7x7 tensor shapes. */
593class Small7x7Shapes final : public ShapeDataset
594{
595public:
596 Small7x7Shapes()
597 : ShapeDataset("Shape",
598 {
599 TensorShape{ 7U, 7U, 7U, 4U },
600 TensorShape{ 7U, 7U, 4U, 13U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000601 TensorShape{ 7U, 7U, 3U, 5U },
602 })
603 {
604 }
605};
606
607/** Data set containing large 7x7 tensor shapes. */
608class Large7x7Shapes final : public ShapeDataset
609{
610public:
611 Large7x7Shapes()
612 : ShapeDataset("Shape",
613 {
614 TensorShape{ 7U, 7U, 32U, 64U },
615 TensorShape{ 7U, 7U, 51U, 13U },
616 TensorShape{ 7U, 7U, 53U, 47U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000617 })
618 {
619 }
620};
621
622/** Data set containing small 7x1 tensor shapes. */
623class Small7x1Shapes final : public ShapeDataset
624{
625public:
626 Small7x1Shapes()
627 : ShapeDataset("Shape",
628 {
629 TensorShape{ 7U, 1U, 7U, 4U },
630 TensorShape{ 7U, 1U, 4U, 13U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000631 TensorShape{ 7U, 1U, 3U, 5U },
632 })
633 {
634 }
635};
636
637/** Data set containing large 7x1 tensor shapes. */
638class Large7x1Shapes final : public ShapeDataset
639{
640public:
641 Large7x1Shapes()
642 : ShapeDataset("Shape",
643 {
644 TensorShape{ 7U, 1U, 32U, 64U },
645 TensorShape{ 7U, 1U, 51U, 13U },
646 TensorShape{ 7U, 1U, 53U, 47U },
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000647 })
648 {
649 }
650};
651
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100652/** Data set containing small tensor shapes for deconvolution. */
653class SmallDeconvolutionShapes final : public ShapeDataset
654{
655public:
656 SmallDeconvolutionShapes()
657 : ShapeDataset("InputShape",
658 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000659 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100660 TensorShape{ 5U, 5U, 3U },
661 TensorShape{ 11U, 13U, 4U, 3U }
662 })
663 {
664 }
665};
666
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000667/** Data set containing tiny tensor shapes for direct convolution. */
668class TinyDirectConvolutionShapes final : public ShapeDataset
669{
670public:
671 TinyDirectConvolutionShapes()
672 : ShapeDataset("InputShape",
673 {
674 // Batch size 1
675 TensorShape{ 11U, 13U, 3U },
676 TensorShape{ 7U, 27U, 3U }
677 })
678 {
679 }
680};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100681/** Data set containing small tensor shapes for direct convolution. */
682class SmallDirectConvolutionShapes final : public ShapeDataset
683{
684public:
685 SmallDirectConvolutionShapes()
686 : ShapeDataset("InputShape",
687 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100688 // Batch size 1
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100689 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100690 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100691 TensorShape{ 32U, 37U, 3U, 4U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100692 })
693 {
694 }
695};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100696
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800697/** Data set containing small tensor shapes for direct convolution. */
698class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
699{
700public:
701 SmallDirectConvolutionTensorShiftShapes()
702 : ShapeDataset("InputShape",
703 {
704 // Batch size 1
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800705 TensorShape{ 32U, 37U, 3U },
706 // Batch size 4
707 TensorShape{ 32U, 37U, 3U, 4U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800708 // Arbitrary batch size
709 TensorShape{ 32U, 37U, 3U, 8U }
710 })
711 {
712 }
713};
714
Giorgio Arena0f170392018-07-18 16:13:12 +0100715/** Data set containing small grouped im2col tensor shapes. */
716class GroupedIm2ColSmallShapes final : public ShapeDataset
717{
718public:
719 GroupedIm2ColSmallShapes()
720 : ShapeDataset("Shape",
721 {
722 TensorShape{ 11U, 11U, 48U },
723 TensorShape{ 27U, 13U, 24U },
724 TensorShape{ 128U, 64U, 12U, 3U },
725 TensorShape{ 11U, 11U, 48U, 4U },
726 TensorShape{ 27U, 13U, 24U, 4U },
727 TensorShape{ 11U, 11U, 48U, 5U }
728 })
729 {
730 }
731};
732
733/** Data set containing large grouped im2col tensor shapes. */
734class GroupedIm2ColLargeShapes final : public ShapeDataset
735{
736public:
737 GroupedIm2ColLargeShapes()
738 : ShapeDataset("Shape",
739 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100740 TensorShape{ 153U, 231U, 12U },
741 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100742 })
743 {
744 }
745};
746
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100747/** Data set containing small grouped weights tensor shapes. */
748class GroupedWeightsSmallShapes final : public ShapeDataset
749{
750public:
751 GroupedWeightsSmallShapes()
752 : ShapeDataset("Shape",
753 {
754 TensorShape{ 3U, 3U, 48U, 120U },
755 TensorShape{ 1U, 3U, 24U, 240U },
756 TensorShape{ 3U, 1U, 12U, 480U },
757 TensorShape{ 5U, 5U, 48U, 120U },
758 TensorShape{ 1U, 5U, 24U, 240U },
759 TensorShape{ 5U, 1U, 48U, 480U }
760 })
761 {
762 }
763};
764
765/** Data set containing large grouped weights tensor shapes. */
766class GroupedWeightsLargeShapes final : public ShapeDataset
767{
768public:
769 GroupedWeightsLargeShapes()
770 : ShapeDataset("Shape",
771 {
772 TensorShape{ 9U, 9U, 96U, 240U },
773 TensorShape{ 7U, 9U, 48U, 480U },
774 TensorShape{ 9U, 7U, 24U, 960U },
775 TensorShape{ 13U, 13U, 96U, 240U },
776 TensorShape{ 11U, 13U, 48U, 480U },
777 TensorShape{ 13U, 11U, 24U, 960U }
778 })
779 {
780 }
781};
782
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000783/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
784class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100785{
786public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000787 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100788 : ShapeDataset("Shape",
789 {
790 TensorShape{ 322U, 243U },
791 TensorShape{ 463U, 879U },
792 TensorShape{ 416U, 651U }
793 })
794 {
795 }
796};
797
Pablo Tello3dd5b682019-03-04 14:14:02 +0000798/** Data set containing tensor shapes for ConcatenateLayer. */
799class ConcatenateLayerShapes final : public ShapeDataset
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100800{
801public:
Pablo Tello3dd5b682019-03-04 14:14:02 +0000802 ConcatenateLayerShapes()
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100803 : ShapeDataset("Shape",
804 {
805 TensorShape{ 232U, 65U, 3U },
806 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100807 TensorShape{ 124U, 65U, 3U },
808 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100809 })
810 {
811 }
812};
813
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100814/** Data set containing global pooling tensor shapes. */
815class GlobalPoolingShapes final : public ShapeDataset
816{
817public:
818 GlobalPoolingShapes()
819 : ShapeDataset("Shape",
820 {
821 // Batch size 1
822 TensorShape{ 9U, 9U },
823 TensorShape{ 13U, 13U, 2U },
824 TensorShape{ 27U, 27U, 1U, 3U },
825 // Batch size 4
826 TensorShape{ 31U, 31U, 3U, 4U },
827 TensorShape{ 34U, 34U, 2U, 4U }
828 })
829 {
830 }
831};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000832/** Data set containing tiny softmax layer shapes. */
833class SoftmaxLayerTinyShapes final : public ShapeDataset
834{
835public:
836 SoftmaxLayerTinyShapes()
837 : ShapeDataset("Shape",
838 {
839 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100840 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000841 })
842 {
843 }
844};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100845
Chunosovd6afedc2017-11-06 22:09:45 +0700846/** Data set containing small softmax layer shapes. */
847class SoftmaxLayerSmallShapes final : public ShapeDataset
848{
849public:
850 SoftmaxLayerSmallShapes()
851 : ShapeDataset("Shape",
852 {
853 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100854 TensorShape{ 256U, 10U },
855 TensorShape{ 353U, 8U },
856 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700857 })
858 {
859 }
860};
861
862/** Data set containing large softmax layer shapes. */
863class SoftmaxLayerLargeShapes final : public ShapeDataset
864{
865public:
866 SoftmaxLayerLargeShapes()
867 : ShapeDataset("Shape",
868 {
869 TensorShape{ 1000U, 10U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100870 TensorShape{ 3989U, 10U },
Chunosovd6afedc2017-11-06 22:09:45 +0700871 TensorShape{ 7339U, 11U },
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100872
873 })
874 {
875 }
876};
877
878/** Data set containing large and small softmax layer 4D shapes. */
879class SoftmaxLayer4DShapes final : public ShapeDataset
880{
881public:
882 SoftmaxLayer4DShapes()
883 : ShapeDataset("Shape",
884 {
885 TensorShape{ 9U, 9U, 9U, 9U },
886 TensorShape{ 256U, 10U, 1U, 9U },
887 TensorShape{ 353U, 8U, 2U },
888 TensorShape{ 781U, 5U, 2U, 2U },
889 TensorShape{ 781U, 11U, 1U, 2U },
Chunosovd6afedc2017-11-06 22:09:45 +0700890 })
891 {
892 }
893};
894
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000895/** Data set containing 2D tensor shapes relative to an image size. */
896class SmallImageShapes final : public ShapeDataset
897{
898public:
899 SmallImageShapes()
900 : ShapeDataset("Shape",
901 {
902 TensorShape{ 640U, 480U },
903 TensorShape{ 800U, 600U },
904 TensorShape{ 1200U, 800U }
905 })
906 {
907 }
908};
909
910/** Data set containing 2D tensor shapes relative to an image size. */
911class LargeImageShapes final : public ShapeDataset
912{
913public:
914 LargeImageShapes()
915 : ShapeDataset("Shape",
916 {
917 TensorShape{ 1920U, 1080U },
918 TensorShape{ 2560U, 1536U },
919 TensorShape{ 3584U, 2048U }
920 })
921 {
922 }
923};
Giorgio Arena73023022018-09-04 14:55:55 +0100924
925/** Data set containing small YOLO tensor shapes. */
926class SmallYOLOShapes final : public ShapeDataset
927{
928public:
929 SmallYOLOShapes()
930 : ShapeDataset("Shape",
931 {
932 // Batch size 1
933 TensorShape{ 11U, 11U, 270U },
934 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100935 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100936 })
937 {
938 }
939};
940
941/** Data set containing large YOLO tensor shapes. */
942class LargeYOLOShapes final : public ShapeDataset
943{
944public:
945 LargeYOLOShapes()
946 : ShapeDataset("Shape",
947 {
948 TensorShape{ 24U, 23U, 270U },
949 TensorShape{ 51U, 63U, 90U, 2U },
950 TensorShape{ 76U, 91U, 45U, 3U }
951 })
952 {
953 }
954};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000955
956/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
957class SmallGEMMReshape2DShapes final : public ShapeDataset
958{
959public:
960 SmallGEMMReshape2DShapes()
961 : ShapeDataset("Shape",
962 {
963 TensorShape{ 63U, 72U },
964 })
965 {
966 }
967};
968
969/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
970class SmallGEMMReshape3DShapes final : public ShapeDataset
971{
972public:
973 SmallGEMMReshape3DShapes()
974 : ShapeDataset("Shape",
975 {
976 TensorShape{ 63U, 9U, 8U },
977 })
978 {
979 }
980};
981
982/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
983class LargeGEMMReshape2DShapes final : public ShapeDataset
984{
985public:
986 LargeGEMMReshape2DShapes()
987 : ShapeDataset("Shape",
988 {
989 TensorShape{ 16U, 27U },
990 TensorShape{ 533U, 171U },
991 TensorShape{ 345U, 612U }
992 })
993 {
994 }
995};
996
997/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
998class LargeGEMMReshape3DShapes final : public ShapeDataset
999{
1000public:
1001 LargeGEMMReshape3DShapes()
1002 : ShapeDataset("Shape",
1003 {
1004 TensorShape{ 16U, 3U, 9U },
1005 TensorShape{ 533U, 19U, 9U },
1006 TensorShape{ 345U, 34U, 18U }
1007 })
1008 {
1009 }
1010};
Pablo Telloe96e4f02018-12-21 16:47:23 +00001011
1012/** Data set containing small 2D tensor shapes. */
1013class Small2DNonMaxSuppressionShapes final : public ShapeDataset
1014{
1015public:
1016 Small2DNonMaxSuppressionShapes()
1017 : ShapeDataset("Shape",
1018 {
1019 TensorShape{ 4U, 7U },
1020 TensorShape{ 4U, 13U },
1021 TensorShape{ 4U, 64U }
1022 })
1023 {
1024 }
1025};
1026
1027/** Data set containing large 2D tensor shapes. */
1028class Large2DNonMaxSuppressionShapes final : public ShapeDataset
1029{
1030public:
1031 Large2DNonMaxSuppressionShapes()
1032 : ShapeDataset("Shape",
1033 {
1034 TensorShape{ 4U, 207U },
1035 TensorShape{ 4U, 113U },
1036 TensorShape{ 4U, 264U }
1037 })
1038 {
1039 }
1040};
1041
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001042} // namespace datasets
1043} // namespace test
1044} // namespace arm_compute
1045#endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */