blob: fddc7731fe43341f40157380b23567e88b64cfd3 [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 },
231 TensorShape{ 128U, 64U, 1U, 3U },
232 // Batch size 4
233 TensorShape{ 37U, 37U, 3U, 4U },
steniu01f81652d2017-09-11 15:29:12 +0100234 // Arbitrary batch size
235 TensorShape{ 37U, 37U, 3U, 5U }
236 })
237 {
238 }
239};
240
Gian Marco37908d92017-11-07 14:38:22 +0000241/** Data set containing medium 2D tensor shapes. */
242class Medium2DShapes final : public ShapeDataset
243{
244public:
245 Medium2DShapes()
246 : ShapeDataset("Shape",
247 {
248 TensorShape{ 42U, 37U },
249 TensorShape{ 57U, 60U },
250 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100251 TensorShape{ 83U, 72U },
252 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000253 })
254 {
255 }
256};
257
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000258/** Data set containing medium 3D tensor shapes. */
259class Medium3DShapes final : public ShapeDataset
260{
261public:
262 Medium3DShapes()
263 : ShapeDataset("Shape",
264 {
265 TensorShape{ 42U, 37U, 8U },
266 TensorShape{ 57U, 60U, 13U },
267 TensorShape{ 128U, 64U, 21U },
268 TensorShape{ 83U, 72U, 14U }
269 })
270 {
271 }
272};
273
274/** Data set containing medium 4D tensor shapes. */
275class Medium4DShapes final : public ShapeDataset
276{
277public:
278 Medium4DShapes()
279 : ShapeDataset("Shape",
280 {
281 TensorShape{ 42U, 37U, 8U, 15U },
282 TensorShape{ 57U, 60U, 13U, 8U },
283 TensorShape{ 128U, 64U, 21U, 13U },
284 TensorShape{ 83U, 72U, 14U, 5U }
285 })
286 {
287 }
288};
289
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100290/** Data set containing large tensor shapes. */
291class LargeShapes final : public ShapeDataset
292{
293public:
294 LargeShapes()
295 : ShapeDataset("Shape",
296 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100297 // Batch size 1
Gian Marco7f0f7902017-12-07 09:26:56 +0000298 TensorShape{ 1921U, 1083U },
299 TensorShape{ 641U, 485U, 2U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100300 // Batch size 4
Gian Marco7f0f7902017-12-07 09:26:56 +0000301 TensorShape{ 799U, 595U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100302 })
303 {
304 }
305};
306
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000307/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
308class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
309{
310public:
311 LargeShapesBroadcast()
312 : ZipDataset<ShapeDataset, ShapeDataset>(
313 ShapeDataset("Shape0",
314 {
315 TensorShape{ 1921U, 541U },
316 TensorShape{ 1U, 485U, 2U, 3U },
317 TensorShape{ 4159U, 1U },
318 TensorShape{ 799U }
319 }),
320 ShapeDataset("Shape1",
321 {
322 TensorShape{ 1921U, 1U, 2U },
323 TensorShape{ 641U, 1U, 2U, 3U },
324 TensorShape{ 1U, 127U, 25U },
325 TensorShape{ 799U, 595U, 1U, 4U }
326 }))
327 {
328 }
329};
330
Gian Marco5420b282017-11-29 10:41:38 +0000331/** Data set containing large 1D tensor shapes. */
332class Large1DShapes final : public ShapeDataset
333{
334public:
335 Large1DShapes()
336 : ShapeDataset("Shape",
337 {
338 TensorShape{ 1921U },
339 TensorShape{ 1245U },
340 TensorShape{ 4160U }
341 })
342 {
343 }
344};
345
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100346/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100347class Large2DShapes final : public ShapeDataset
348{
349public:
350 Large2DShapes()
351 : ShapeDataset("Shape",
352 {
353 TensorShape{ 1920U, 1080U },
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +0100354 TensorShape{ 1245U, 652U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100355 TensorShape{ 4160U, 3120U }
356 })
357 {
358 }
359};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100360
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100361/** Data set containing large 3D tensor shapes. */
362class Large3DShapes final : public ShapeDataset
363{
364public:
365 Large3DShapes()
366 : ShapeDataset("Shape",
367 {
368 TensorShape{ 320U, 240U, 3U },
369 TensorShape{ 383U, 653U, 2U },
370 TensorShape{ 721U, 123U, 13U }
371 })
372 {
373 }
374};
375
376/** Data set containing large 4D tensor shapes. */
377class Large4DShapes final : public ShapeDataset
378{
379public:
380 Large4DShapes()
381 : ShapeDataset("Shape",
382 {
383 TensorShape{ 320U, 123U, 3U, 3U },
384 TensorShape{ 383U, 413U, 2U, 3U },
385 TensorShape{ 517U, 123U, 13U, 2U }
386 })
387 {
388 }
389};
390
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000391/** Data set containing small 3x3 tensor shapes. */
392class Small3x3Shapes final : public ShapeDataset
393{
394public:
395 Small3x3Shapes()
396 : ShapeDataset("Shape",
397 {
398 TensorShape{ 3U, 3U, 7U, 4U },
399 TensorShape{ 3U, 3U, 4U, 13U },
400 TensorShape{ 3U, 3U, 9U, 2U },
401 TensorShape{ 3U, 3U, 3U, 5U },
402 })
403 {
404 }
405};
406
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100407/** Data set containing small 3x1 tensor shapes. */
408class Small3x1Shapes final : public ShapeDataset
409{
410public:
411 Small3x1Shapes()
412 : ShapeDataset("Shape",
413 {
414 TensorShape{ 3U, 1U, 7U, 4U },
415 TensorShape{ 3U, 1U, 4U, 13U },
416 TensorShape{ 3U, 1U, 9U, 2U },
417 TensorShape{ 3U, 1U, 3U, 5U },
418 })
419 {
420 }
421};
422
423/** Data set containing small 1x3 tensor shapes. */
424class Small1x3Shapes final : public ShapeDataset
425{
426public:
427 Small1x3Shapes()
428 : ShapeDataset("Shape",
429 {
430 TensorShape{ 1U, 3U, 7U, 4U },
431 TensorShape{ 1U, 3U, 4U, 13U },
432 TensorShape{ 1U, 3U, 9U, 2U },
433 TensorShape{ 1U, 3U, 3U, 5U },
434 })
435 {
436 }
437};
438
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000439/** Data set containing large 3x3 tensor shapes. */
440class Large3x3Shapes final : public ShapeDataset
441{
442public:
443 Large3x3Shapes()
444 : ShapeDataset("Shape",
445 {
446 TensorShape{ 3U, 3U, 32U, 64U },
447 TensorShape{ 3U, 3U, 51U, 13U },
448 TensorShape{ 3U, 3U, 53U, 47U },
449 TensorShape{ 3U, 3U, 128U, 384U },
450 })
451 {
452 }
453};
454
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100455/** Data set containing large 3x1 tensor shapes. */
456class Large3x1Shapes final : public ShapeDataset
457{
458public:
459 Large3x1Shapes()
460 : ShapeDataset("Shape",
461 {
462 TensorShape{ 3U, 1U, 32U, 64U },
463 TensorShape{ 3U, 1U, 51U, 13U },
464 TensorShape{ 3U, 1U, 53U, 47U },
465 TensorShape{ 3U, 1U, 128U, 384U },
466 })
467 {
468 }
469};
470
471/** Data set containing large 1x3 tensor shapes. */
472class Large1x3Shapes final : public ShapeDataset
473{
474public:
475 Large1x3Shapes()
476 : ShapeDataset("Shape",
477 {
478 TensorShape{ 1U, 3U, 32U, 64U },
479 TensorShape{ 1U, 3U, 51U, 13U },
480 TensorShape{ 1U, 3U, 53U, 47U },
481 TensorShape{ 1U, 3U, 128U, 384U },
482 })
483 {
484 }
485};
486
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100487/** Data set containing small 5x5 tensor shapes. */
488class Small5x5Shapes final : public ShapeDataset
489{
490public:
491 Small5x5Shapes()
492 : ShapeDataset("Shape",
493 {
494 TensorShape{ 5U, 5U, 7U, 4U },
495 TensorShape{ 5U, 5U, 4U, 13U },
496 TensorShape{ 5U, 5U, 9U, 2U },
497 TensorShape{ 5U, 5U, 3U, 5U },
498 })
499 {
500 }
501};
502
503/** Data set containing large 5x5 tensor shapes. */
504class Large5x5Shapes final : public ShapeDataset
505{
506public:
507 Large5x5Shapes()
508 : ShapeDataset("Shape",
509 {
510 TensorShape{ 5U, 5U, 32U, 64U },
511 TensorShape{ 5U, 5U, 51U, 13U },
512 TensorShape{ 5U, 5U, 53U, 47U },
513 TensorShape{ 5U, 5U, 128U, 384U },
514 })
515 {
516 }
517};
518
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100519/** Data set containing small 5x1 tensor shapes. */
520class Small5x1Shapes final : public ShapeDataset
521{
522public:
523 Small5x1Shapes()
524 : ShapeDataset("Shape",
525 {
526 TensorShape{ 5U, 1U, 7U, 4U },
527 TensorShape{ 5U, 1U, 4U, 13U },
528 TensorShape{ 5U, 1U, 9U, 2U },
529 TensorShape{ 5U, 1U, 3U, 5U },
530 })
531 {
532 }
533};
534
535/** Data set containing large 5x1 tensor shapes. */
536class Large5x1Shapes final : public ShapeDataset
537{
538public:
539 Large5x1Shapes()
540 : ShapeDataset("Shape",
541 {
542 TensorShape{ 5U, 1U, 32U, 64U },
543 TensorShape{ 5U, 1U, 51U, 13U },
544 TensorShape{ 5U, 1U, 53U, 47U },
545 TensorShape{ 5U, 1U, 128U, 384U },
546 })
547 {
548 }
549};
550
551/** Data set containing small 1x5 tensor shapes. */
552class Small1x5Shapes final : public ShapeDataset
553{
554public:
555 Small1x5Shapes()
556 : ShapeDataset("Shape",
557 {
558 TensorShape{ 1U, 5U, 7U, 4U },
559 TensorShape{ 1U, 5U, 4U, 13U },
560 TensorShape{ 1U, 5U, 9U, 2U },
561 TensorShape{ 1U, 5U, 3U, 5U },
562 })
563 {
564 }
565};
566
567/** Data set containing large 1x5 tensor shapes. */
568class Large1x5Shapes final : public ShapeDataset
569{
570public:
571 Large1x5Shapes()
572 : ShapeDataset("Shape",
573 {
574 TensorShape{ 1U, 5U, 32U, 64U },
575 TensorShape{ 1U, 5U, 51U, 13U },
576 TensorShape{ 1U, 5U, 53U, 47U },
577 TensorShape{ 1U, 5U, 128U, 384U },
578 })
579 {
580 }
581};
582
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100583/** Data set containing small tensor shapes for deconvolution. */
584class SmallDeconvolutionShapes final : public ShapeDataset
585{
586public:
587 SmallDeconvolutionShapes()
588 : ShapeDataset("InputShape",
589 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000590 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100591 TensorShape{ 5U, 5U, 3U },
592 TensorShape{ 11U, 13U, 4U, 3U }
593 })
594 {
595 }
596};
597
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000598/** Data set containing tiny tensor shapes for direct convolution. */
599class TinyDirectConvolutionShapes final : public ShapeDataset
600{
601public:
602 TinyDirectConvolutionShapes()
603 : ShapeDataset("InputShape",
604 {
605 // Batch size 1
606 TensorShape{ 11U, 13U, 3U },
607 TensorShape{ 7U, 27U, 3U }
608 })
609 {
610 }
611};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100612/** Data set containing small tensor shapes for direct convolution. */
613class SmallDirectConvolutionShapes final : public ShapeDataset
614{
615public:
616 SmallDirectConvolutionShapes()
617 : ShapeDataset("InputShape",
618 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100619 // Batch size 1
steniu01f81652d2017-09-11 15:29:12 +0100620 TensorShape{ 35U, 35U, 3U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100621 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100622 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100623 TensorShape{ 32U, 37U, 3U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100624 // Batch size 8
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000625 TensorShape{ 33U, 35U, 8U, 8U }
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100626 })
627 {
628 }
629};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100630
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800631/** Data set containing small tensor shapes for direct convolution. */
632class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
633{
634public:
635 SmallDirectConvolutionTensorShiftShapes()
636 : ShapeDataset("InputShape",
637 {
638 // Batch size 1
639 TensorShape{ 35U, 35U, 3U },
640 TensorShape{ 32U, 37U, 3U },
641 // Batch size 4
642 TensorShape{ 32U, 37U, 3U, 4U },
643 // Batch size 8
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800644 TensorShape{ 33U, 35U, 3U, 8U },
645 // Arbitrary batch size
646 TensorShape{ 32U, 37U, 3U, 8U }
647 })
648 {
649 }
650};
651
Giorgio Arena0f170392018-07-18 16:13:12 +0100652/** Data set containing small grouped im2col tensor shapes. */
653class GroupedIm2ColSmallShapes final : public ShapeDataset
654{
655public:
656 GroupedIm2ColSmallShapes()
657 : ShapeDataset("Shape",
658 {
659 TensorShape{ 11U, 11U, 48U },
660 TensorShape{ 27U, 13U, 24U },
661 TensorShape{ 128U, 64U, 12U, 3U },
662 TensorShape{ 11U, 11U, 48U, 4U },
663 TensorShape{ 27U, 13U, 24U, 4U },
664 TensorShape{ 11U, 11U, 48U, 5U }
665 })
666 {
667 }
668};
669
670/** Data set containing large grouped im2col tensor shapes. */
671class GroupedIm2ColLargeShapes final : public ShapeDataset
672{
673public:
674 GroupedIm2ColLargeShapes()
675 : ShapeDataset("Shape",
676 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100677 TensorShape{ 153U, 231U, 12U },
678 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100679 })
680 {
681 }
682};
683
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100684/** Data set containing small grouped weights tensor shapes. */
685class GroupedWeightsSmallShapes final : public ShapeDataset
686{
687public:
688 GroupedWeightsSmallShapes()
689 : ShapeDataset("Shape",
690 {
691 TensorShape{ 3U, 3U, 48U, 120U },
692 TensorShape{ 1U, 3U, 24U, 240U },
693 TensorShape{ 3U, 1U, 12U, 480U },
694 TensorShape{ 5U, 5U, 48U, 120U },
695 TensorShape{ 1U, 5U, 24U, 240U },
696 TensorShape{ 5U, 1U, 48U, 480U }
697 })
698 {
699 }
700};
701
702/** Data set containing large grouped weights tensor shapes. */
703class GroupedWeightsLargeShapes final : public ShapeDataset
704{
705public:
706 GroupedWeightsLargeShapes()
707 : ShapeDataset("Shape",
708 {
709 TensorShape{ 9U, 9U, 96U, 240U },
710 TensorShape{ 7U, 9U, 48U, 480U },
711 TensorShape{ 9U, 7U, 24U, 960U },
712 TensorShape{ 13U, 13U, 96U, 240U },
713 TensorShape{ 11U, 13U, 48U, 480U },
714 TensorShape{ 13U, 11U, 24U, 960U }
715 })
716 {
717 }
718};
719
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000720/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
721class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100722{
723public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000724 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100725 : ShapeDataset("Shape",
726 {
727 TensorShape{ 322U, 243U },
728 TensorShape{ 463U, 879U },
729 TensorShape{ 416U, 651U }
730 })
731 {
732 }
733};
734
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100735/** Data set containing tensor shapes for WidthConcatenateLayer. */
736class WidthConcatenateLayerShapes final : public ShapeDataset
737{
738public:
739 WidthConcatenateLayerShapes()
740 : ShapeDataset("Shape",
741 {
742 TensorShape{ 232U, 65U, 3U },
743 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100744 TensorShape{ 124U, 65U, 3U },
745 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100746 })
747 {
748 }
749};
750
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100751/** Data set containing global pooling tensor shapes. */
752class GlobalPoolingShapes final : public ShapeDataset
753{
754public:
755 GlobalPoolingShapes()
756 : ShapeDataset("Shape",
757 {
758 // Batch size 1
759 TensorShape{ 9U, 9U },
760 TensorShape{ 13U, 13U, 2U },
761 TensorShape{ 27U, 27U, 1U, 3U },
762 // Batch size 4
763 TensorShape{ 31U, 31U, 3U, 4U },
764 TensorShape{ 34U, 34U, 2U, 4U }
765 })
766 {
767 }
768};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000769/** Data set containing tiny softmax layer shapes. */
770class SoftmaxLayerTinyShapes final : public ShapeDataset
771{
772public:
773 SoftmaxLayerTinyShapes()
774 : ShapeDataset("Shape",
775 {
776 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100777 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000778 })
779 {
780 }
781};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100782
Chunosovd6afedc2017-11-06 22:09:45 +0700783/** Data set containing small softmax layer shapes. */
784class SoftmaxLayerSmallShapes final : public ShapeDataset
785{
786public:
787 SoftmaxLayerSmallShapes()
788 : ShapeDataset("Shape",
789 {
790 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100791 TensorShape{ 256U, 10U },
792 TensorShape{ 353U, 8U },
793 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700794 })
795 {
796 }
797};
798
799/** Data set containing large softmax layer shapes. */
800class SoftmaxLayerLargeShapes final : public ShapeDataset
801{
802public:
803 SoftmaxLayerLargeShapes()
804 : ShapeDataset("Shape",
805 {
806 TensorShape{ 1000U, 10U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100807 TensorShape{ 3989U, 10U },
Chunosovd6afedc2017-11-06 22:09:45 +0700808 TensorShape{ 7339U, 11U },
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100809
810 })
811 {
812 }
813};
814
815/** Data set containing large and small softmax layer 4D shapes. */
816class SoftmaxLayer4DShapes final : public ShapeDataset
817{
818public:
819 SoftmaxLayer4DShapes()
820 : ShapeDataset("Shape",
821 {
822 TensorShape{ 9U, 9U, 9U, 9U },
823 TensorShape{ 256U, 10U, 1U, 9U },
824 TensorShape{ 353U, 8U, 2U },
825 TensorShape{ 781U, 5U, 2U, 2U },
826 TensorShape{ 781U, 11U, 1U, 2U },
Chunosovd6afedc2017-11-06 22:09:45 +0700827 })
828 {
829 }
830};
831
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000832/** Data set containing 2D tensor shapes relative to an image size. */
833class SmallImageShapes final : public ShapeDataset
834{
835public:
836 SmallImageShapes()
837 : ShapeDataset("Shape",
838 {
839 TensorShape{ 640U, 480U },
840 TensorShape{ 800U, 600U },
841 TensorShape{ 1200U, 800U }
842 })
843 {
844 }
845};
846
847/** Data set containing 2D tensor shapes relative to an image size. */
848class LargeImageShapes final : public ShapeDataset
849{
850public:
851 LargeImageShapes()
852 : ShapeDataset("Shape",
853 {
854 TensorShape{ 1920U, 1080U },
855 TensorShape{ 2560U, 1536U },
856 TensorShape{ 3584U, 2048U }
857 })
858 {
859 }
860};
Giorgio Arena73023022018-09-04 14:55:55 +0100861
862/** Data set containing small YOLO tensor shapes. */
863class SmallYOLOShapes final : public ShapeDataset
864{
865public:
866 SmallYOLOShapes()
867 : ShapeDataset("Shape",
868 {
869 // Batch size 1
870 TensorShape{ 11U, 11U, 270U },
871 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100872 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100873 })
874 {
875 }
876};
877
878/** Data set containing large YOLO tensor shapes. */
879class LargeYOLOShapes final : public ShapeDataset
880{
881public:
882 LargeYOLOShapes()
883 : ShapeDataset("Shape",
884 {
885 TensorShape{ 24U, 23U, 270U },
886 TensorShape{ 51U, 63U, 90U, 2U },
887 TensorShape{ 76U, 91U, 45U, 3U }
888 })
889 {
890 }
891};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000892
893/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
894class SmallGEMMReshape2DShapes final : public ShapeDataset
895{
896public:
897 SmallGEMMReshape2DShapes()
898 : ShapeDataset("Shape",
899 {
900 TensorShape{ 63U, 72U },
901 })
902 {
903 }
904};
905
906/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
907class SmallGEMMReshape3DShapes final : public ShapeDataset
908{
909public:
910 SmallGEMMReshape3DShapes()
911 : ShapeDataset("Shape",
912 {
913 TensorShape{ 63U, 9U, 8U },
914 })
915 {
916 }
917};
918
919/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
920class LargeGEMMReshape2DShapes final : public ShapeDataset
921{
922public:
923 LargeGEMMReshape2DShapes()
924 : ShapeDataset("Shape",
925 {
926 TensorShape{ 16U, 27U },
927 TensorShape{ 533U, 171U },
928 TensorShape{ 345U, 612U }
929 })
930 {
931 }
932};
933
934/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
935class LargeGEMMReshape3DShapes final : public ShapeDataset
936{
937public:
938 LargeGEMMReshape3DShapes()
939 : ShapeDataset("Shape",
940 {
941 TensorShape{ 16U, 3U, 9U },
942 TensorShape{ 533U, 19U, 9U },
943 TensorShape{ 345U, 34U, 18U }
944 })
945 {
946 }
947};
Pablo Tellod85a77a2018-12-21 16:47:23 +0000948
949/** Data set containing small 2D tensor shapes. */
950class Small2DNonMaxSuppressionShapes final : public ShapeDataset
951{
952public:
953 Small2DNonMaxSuppressionShapes()
954 : ShapeDataset("Shape",
955 {
956 TensorShape{ 4U, 7U },
957 TensorShape{ 4U, 13U },
958 TensorShape{ 4U, 64U }
959 })
960 {
961 }
962};
963
964/** Data set containing large 2D tensor shapes. */
965class Large2DNonMaxSuppressionShapes final : public ShapeDataset
966{
967public:
968 Large2DNonMaxSuppressionShapes()
969 : ShapeDataset("Shape",
970 {
971 TensorShape{ 4U, 207U },
972 TensorShape{ 4U, 113U },
973 TensorShape{ 4U, 264U }
974 })
975 {
976 }
977};
978
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100979} // namespace datasets
980} // namespace test
981} // namespace arm_compute
982#endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */