blob: a7f1a44286da5b856b7f20e1b8eaa7f0be30c4e9 [file] [log] [blame]
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001/*
Michele Di Giorgiod556d7b2020-10-27 10:56:31 +00002 * Copyright (c) 2017-2021 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 */
Michalis Spyrouf4643372019-11-29 16:17:13 +000024#ifndef ARM_COMPUTE_TEST_SHAPE_DATASETS_H
25#define ARM_COMPUTE_TEST_SHAPE_DATASETS_H
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010026
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 },
Giorgio Arena53048842020-10-07 16:03:43 +0100124 TensorShape{ 16U, 16U, 5U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100125 TensorShape{ 27U, 13U, 37U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100126 })
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
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000160/** Data set containing tiny 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 },
Giorgio Arenad304adb2020-10-02 10:20:11 +0100183 TensorShape{ 16U, 16U },
Georgios Pinitas64f1a902018-09-18 13:42:51 +0100184 TensorShape{ 27U, 13U, 7U },
Michele Di Giorgiod556d7b2020-10-27 10:56:31 +0000185 TensorShape{ 7U, 7U, 17U, 2U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100186 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100187 TensorShape{ 27U, 13U, 2U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100188 // Arbitrary batch size
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100189 TensorShape{ 11U, 11U, 3U, 5U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100190 })
191 {
192 }
193};
194
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000195/** Data set containing pairs of tiny tensor shapes that are broadcast compatible. */
196class TinyShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
197{
198public:
199 TinyShapesBroadcast()
200 : ZipDataset<ShapeDataset, ShapeDataset>(
201 ShapeDataset("Shape0",
202 {
203 TensorShape{ 9U, 9U },
204 TensorShape{ 10U, 2U, 14U, 2U },
205 }),
206 ShapeDataset("Shape1",
207 {
208 TensorShape{ 9U, 1U, 9U },
209 TensorShape{ 10U },
210 }))
211 {
212 }
213};
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000214/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
215class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
216{
217public:
218 SmallShapesBroadcast()
219 : ZipDataset<ShapeDataset, ShapeDataset>(
220 ShapeDataset("Shape0",
221 {
222 TensorShape{ 9U, 9U },
223 TensorShape{ 27U, 13U, 2U },
224 TensorShape{ 128U, 1U, 5U, 3U },
225 TensorShape{ 9U, 9U, 3U, 4U },
226 TensorShape{ 27U, 13U, 2U, 4U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100227 TensorShape{ 1U, 1U, 1U, 5U },
228 TensorShape{ 1U, 16U, 10U, 2U, 128U },
229 TensorShape{ 1U, 16U, 10U, 2U, 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000230 }),
231 ShapeDataset("Shape1",
232 {
233 TensorShape{ 9U, 1U, 2U },
234 TensorShape{ 1U, 13U, 2U },
235 TensorShape{ 128U, 64U, 1U, 3U },
236 TensorShape{ 9U, 1U, 3U },
237 TensorShape{ 1U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100238 TensorShape{ 9U, 9U, 3U, 5U },
239 TensorShape{ 1U, 1U, 1U, 1U, 128U },
240 TensorShape{ 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000241 }))
242 {
243 }
244};
245
steniu01f81652d2017-09-11 15:29:12 +0100246/** Data set containing medium tensor shapes. */
247class MediumShapes final : public ShapeDataset
248{
249public:
250 MediumShapes()
251 : ShapeDataset("Shape",
252 {
253 // Batch size 1
254 TensorShape{ 37U, 37U },
255 TensorShape{ 27U, 33U, 2U },
steniu01f81652d2017-09-11 15:29:12 +0100256 // Arbitrary batch size
257 TensorShape{ 37U, 37U, 3U, 5U }
258 })
259 {
260 }
261};
262
Gian Marco37908d92017-11-07 14:38:22 +0000263/** Data set containing medium 2D tensor shapes. */
264class Medium2DShapes final : public ShapeDataset
265{
266public:
267 Medium2DShapes()
268 : ShapeDataset("Shape",
269 {
270 TensorShape{ 42U, 37U },
271 TensorShape{ 57U, 60U },
272 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100273 TensorShape{ 83U, 72U },
274 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000275 })
276 {
277 }
278};
279
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000280/** Data set containing medium 3D tensor shapes. */
281class Medium3DShapes final : public ShapeDataset
282{
283public:
284 Medium3DShapes()
285 : ShapeDataset("Shape",
286 {
287 TensorShape{ 42U, 37U, 8U },
288 TensorShape{ 57U, 60U, 13U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000289 TensorShape{ 83U, 72U, 14U }
290 })
291 {
292 }
293};
294
295/** Data set containing medium 4D tensor shapes. */
296class Medium4DShapes final : public ShapeDataset
297{
298public:
299 Medium4DShapes()
300 : ShapeDataset("Shape",
301 {
302 TensorShape{ 42U, 37U, 8U, 15U },
303 TensorShape{ 57U, 60U, 13U, 8U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000304 TensorShape{ 83U, 72U, 14U, 5U }
305 })
306 {
307 }
308};
309
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100310/** Data set containing large tensor shapes. */
311class LargeShapes final : public ShapeDataset
312{
313public:
314 LargeShapes()
315 : ShapeDataset("Shape",
316 {
Michalis Spyrou97b2bb12019-05-28 16:59:27 +0100317 TensorShape{ 582U, 131U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100318 })
319 {
320 }
321};
322
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000323/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
324class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
325{
326public:
327 LargeShapesBroadcast()
328 : ZipDataset<ShapeDataset, ShapeDataset>(
329 ShapeDataset("Shape0",
330 {
331 TensorShape{ 1921U, 541U },
332 TensorShape{ 1U, 485U, 2U, 3U },
333 TensorShape{ 4159U, 1U },
334 TensorShape{ 799U }
335 }),
336 ShapeDataset("Shape1",
337 {
338 TensorShape{ 1921U, 1U, 2U },
339 TensorShape{ 641U, 1U, 2U, 3U },
340 TensorShape{ 1U, 127U, 25U },
341 TensorShape{ 799U, 595U, 1U, 4U }
342 }))
343 {
344 }
345};
346
Gian Marco5420b282017-11-29 10:41:38 +0000347/** Data set containing large 1D tensor shapes. */
348class Large1DShapes final : public ShapeDataset
349{
350public:
351 Large1DShapes()
352 : ShapeDataset("Shape",
353 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000354 TensorShape{ 1245U }
Gian Marco5420b282017-11-29 10:41:38 +0000355 })
356 {
357 }
358};
359
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100360/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100361class Large2DShapes final : public ShapeDataset
362{
363public:
364 Large2DShapes()
365 : ShapeDataset("Shape",
366 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000367 TensorShape{ 1245U, 652U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100368 })
369 {
370 }
371};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100372
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100373/** Data set containing large 3D tensor shapes. */
374class Large3DShapes final : public ShapeDataset
375{
376public:
377 Large3DShapes()
378 : ShapeDataset("Shape",
379 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000380 TensorShape{ 320U, 240U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100381 })
382 {
383 }
384};
385
386/** Data set containing large 4D tensor shapes. */
387class Large4DShapes final : public ShapeDataset
388{
389public:
390 Large4DShapes()
391 : ShapeDataset("Shape",
392 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000393 TensorShape{ 320U, 123U, 3U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100394 })
395 {
396 }
397};
398
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000399/** Data set containing small 3x3 tensor shapes. */
400class Small3x3Shapes final : public ShapeDataset
401{
402public:
403 Small3x3Shapes()
404 : ShapeDataset("Shape",
405 {
406 TensorShape{ 3U, 3U, 7U, 4U },
407 TensorShape{ 3U, 3U, 4U, 13U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000408 TensorShape{ 3U, 3U, 3U, 5U },
409 })
410 {
411 }
412};
413
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100414/** Data set containing small 3x1 tensor shapes. */
415class Small3x1Shapes final : public ShapeDataset
416{
417public:
418 Small3x1Shapes()
419 : ShapeDataset("Shape",
420 {
421 TensorShape{ 3U, 1U, 7U, 4U },
422 TensorShape{ 3U, 1U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100423 TensorShape{ 3U, 1U, 3U, 5U },
424 })
425 {
426 }
427};
428
429/** Data set containing small 1x3 tensor shapes. */
430class Small1x3Shapes final : public ShapeDataset
431{
432public:
433 Small1x3Shapes()
434 : ShapeDataset("Shape",
435 {
436 TensorShape{ 1U, 3U, 7U, 4U },
437 TensorShape{ 1U, 3U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100438 TensorShape{ 1U, 3U, 3U, 5U },
439 })
440 {
441 }
442};
443
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000444/** Data set containing large 3x3 tensor shapes. */
445class Large3x3Shapes final : public ShapeDataset
446{
447public:
448 Large3x3Shapes()
449 : ShapeDataset("Shape",
450 {
451 TensorShape{ 3U, 3U, 32U, 64U },
452 TensorShape{ 3U, 3U, 51U, 13U },
453 TensorShape{ 3U, 3U, 53U, 47U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000454 })
455 {
456 }
457};
458
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100459/** Data set containing large 3x1 tensor shapes. */
460class Large3x1Shapes final : public ShapeDataset
461{
462public:
463 Large3x1Shapes()
464 : ShapeDataset("Shape",
465 {
466 TensorShape{ 3U, 1U, 32U, 64U },
467 TensorShape{ 3U, 1U, 51U, 13U },
468 TensorShape{ 3U, 1U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100469 })
470 {
471 }
472};
473
474/** Data set containing large 1x3 tensor shapes. */
475class Large1x3Shapes final : public ShapeDataset
476{
477public:
478 Large1x3Shapes()
479 : ShapeDataset("Shape",
480 {
481 TensorShape{ 1U, 3U, 32U, 64U },
482 TensorShape{ 1U, 3U, 51U, 13U },
483 TensorShape{ 1U, 3U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100484 })
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 },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100498 TensorShape{ 5U, 5U, 3U, 5U },
499 })
500 {
501 }
502};
503
504/** Data set containing large 5x5 tensor shapes. */
505class Large5x5Shapes final : public ShapeDataset
506{
507public:
508 Large5x5Shapes()
509 : ShapeDataset("Shape",
510 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000511 TensorShape{ 5U, 5U, 32U, 64U }
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100512 })
513 {
514 }
515};
516
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100517/** Data set containing small 5x1 tensor shapes. */
518class Small5x1Shapes final : public ShapeDataset
519{
520public:
521 Small5x1Shapes()
522 : ShapeDataset("Shape",
523 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000524 TensorShape{ 5U, 1U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100525 })
526 {
527 }
528};
529
530/** Data set containing large 5x1 tensor shapes. */
531class Large5x1Shapes final : public ShapeDataset
532{
533public:
534 Large5x1Shapes()
535 : ShapeDataset("Shape",
536 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000537 TensorShape{ 5U, 1U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100538 })
539 {
540 }
541};
542
543/** Data set containing small 1x5 tensor shapes. */
544class Small1x5Shapes final : public ShapeDataset
545{
546public:
547 Small1x5Shapes()
548 : ShapeDataset("Shape",
549 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000550 TensorShape{ 1U, 5U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100551 })
552 {
553 }
554};
555
556/** Data set containing large 1x5 tensor shapes. */
557class Large1x5Shapes final : public ShapeDataset
558{
559public:
560 Large1x5Shapes()
561 : ShapeDataset("Shape",
562 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000563 TensorShape{ 1U, 5U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100564 })
565 {
566 }
567};
568
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000569/** Data set containing small 1x7 tensor shapes. */
570class Small1x7Shapes final : public ShapeDataset
571{
572public:
573 Small1x7Shapes()
574 : ShapeDataset("Shape",
575 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000576 TensorShape{ 1U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000577 })
578 {
579 }
580};
581
582/** Data set containing large 1x7 tensor shapes. */
583class Large1x7Shapes final : public ShapeDataset
584{
585public:
586 Large1x7Shapes()
587 : ShapeDataset("Shape",
588 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000589 TensorShape{ 1U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000590 })
591 {
592 }
593};
594
595/** Data set containing small 7x7 tensor shapes. */
596class Small7x7Shapes final : public ShapeDataset
597{
598public:
599 Small7x7Shapes()
600 : ShapeDataset("Shape",
601 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000602 TensorShape{ 7U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000603 })
604 {
605 }
606};
607
608/** Data set containing large 7x7 tensor shapes. */
609class Large7x7Shapes final : public ShapeDataset
610{
611public:
612 Large7x7Shapes()
613 : ShapeDataset("Shape",
614 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000615 TensorShape{ 7U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000616 })
617 {
618 }
619};
620
621/** Data set containing small 7x1 tensor shapes. */
622class Small7x1Shapes final : public ShapeDataset
623{
624public:
625 Small7x1Shapes()
626 : ShapeDataset("Shape",
627 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000628 TensorShape{ 7U, 1U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000629 })
630 {
631 }
632};
633
634/** Data set containing large 7x1 tensor shapes. */
635class Large7x1Shapes final : public ShapeDataset
636{
637public:
638 Large7x1Shapes()
639 : ShapeDataset("Shape",
640 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000641 TensorShape{ 7U, 1U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000642 })
643 {
644 }
645};
646
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100647/** Data set containing small tensor shapes for deconvolution. */
648class SmallDeconvolutionShapes final : public ShapeDataset
649{
650public:
651 SmallDeconvolutionShapes()
652 : ShapeDataset("InputShape",
653 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000654 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100655 TensorShape{ 5U, 5U, 3U },
656 TensorShape{ 11U, 13U, 4U, 3U }
657 })
658 {
659 }
660};
661
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000662/** Data set containing tiny tensor shapes for direct convolution. */
663class TinyDirectConvolutionShapes final : public ShapeDataset
664{
665public:
666 TinyDirectConvolutionShapes()
667 : ShapeDataset("InputShape",
668 {
669 // Batch size 1
670 TensorShape{ 11U, 13U, 3U },
671 TensorShape{ 7U, 27U, 3U }
672 })
673 {
674 }
675};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100676/** Data set containing small tensor shapes for direct convolution. */
677class SmallDirectConvolutionShapes final : public ShapeDataset
678{
679public:
680 SmallDirectConvolutionShapes()
681 : ShapeDataset("InputShape",
682 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100683 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100684 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100685 // Batch size 4
Gian Marco Iodice0841ca02021-02-01 14:37:02 +0000686 TensorShape{ 6U, 9U, 5U, 4U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100687 })
688 {
689 }
690};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100691
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800692/** Data set containing small tensor shapes for direct convolution. */
693class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
694{
695public:
696 SmallDirectConvolutionTensorShiftShapes()
697 : ShapeDataset("InputShape",
698 {
699 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100700 TensorShape{ 32U, 37U, 3U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800701 // Batch size 4
702 TensorShape{ 32U, 37U, 3U, 4U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800703 // Arbitrary batch size
704 TensorShape{ 32U, 37U, 3U, 8U }
705 })
706 {
707 }
708};
709
Giorgio Arena0f170392018-07-18 16:13:12 +0100710/** Data set containing small grouped im2col tensor shapes. */
711class GroupedIm2ColSmallShapes final : public ShapeDataset
712{
713public:
714 GroupedIm2ColSmallShapes()
715 : ShapeDataset("Shape",
716 {
717 TensorShape{ 11U, 11U, 48U },
718 TensorShape{ 27U, 13U, 24U },
719 TensorShape{ 128U, 64U, 12U, 3U },
720 TensorShape{ 11U, 11U, 48U, 4U },
721 TensorShape{ 27U, 13U, 24U, 4U },
722 TensorShape{ 11U, 11U, 48U, 5U }
723 })
724 {
725 }
726};
727
728/** Data set containing large grouped im2col tensor shapes. */
729class GroupedIm2ColLargeShapes final : public ShapeDataset
730{
731public:
732 GroupedIm2ColLargeShapes()
733 : ShapeDataset("Shape",
734 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100735 TensorShape{ 153U, 231U, 12U },
736 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100737 })
738 {
739 }
740};
741
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100742/** Data set containing small grouped weights tensor shapes. */
743class GroupedWeightsSmallShapes final : public ShapeDataset
744{
745public:
746 GroupedWeightsSmallShapes()
747 : ShapeDataset("Shape",
748 {
749 TensorShape{ 3U, 3U, 48U, 120U },
750 TensorShape{ 1U, 3U, 24U, 240U },
751 TensorShape{ 3U, 1U, 12U, 480U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000752 TensorShape{ 5U, 5U, 48U, 120U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100753 })
754 {
755 }
756};
757
758/** Data set containing large grouped weights tensor shapes. */
759class GroupedWeightsLargeShapes final : public ShapeDataset
760{
761public:
762 GroupedWeightsLargeShapes()
763 : ShapeDataset("Shape",
764 {
765 TensorShape{ 9U, 9U, 96U, 240U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000766 TensorShape{ 13U, 13U, 96U, 240U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100767 })
768 {
769 }
770};
771
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000772/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
773class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100774{
775public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000776 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100777 : ShapeDataset("Shape",
778 {
779 TensorShape{ 322U, 243U },
780 TensorShape{ 463U, 879U },
781 TensorShape{ 416U, 651U }
782 })
783 {
784 }
785};
786
Pablo Tello3dd5b682019-03-04 14:14:02 +0000787/** Data set containing tensor shapes for ConcatenateLayer. */
788class ConcatenateLayerShapes final : public ShapeDataset
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100789{
790public:
Pablo Tello3dd5b682019-03-04 14:14:02 +0000791 ConcatenateLayerShapes()
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100792 : ShapeDataset("Shape",
793 {
794 TensorShape{ 232U, 65U, 3U },
795 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100796 TensorShape{ 124U, 65U, 3U },
797 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100798 })
799 {
800 }
801};
802
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100803/** Data set containing global pooling tensor shapes. */
804class GlobalPoolingShapes final : public ShapeDataset
805{
806public:
807 GlobalPoolingShapes()
808 : ShapeDataset("Shape",
809 {
810 // Batch size 1
811 TensorShape{ 9U, 9U },
812 TensorShape{ 13U, 13U, 2U },
813 TensorShape{ 27U, 27U, 1U, 3U },
814 // Batch size 4
815 TensorShape{ 31U, 31U, 3U, 4U },
816 TensorShape{ 34U, 34U, 2U, 4U }
817 })
818 {
819 }
820};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000821/** Data set containing tiny softmax layer shapes. */
822class SoftmaxLayerTinyShapes final : public ShapeDataset
823{
824public:
825 SoftmaxLayerTinyShapes()
826 : ShapeDataset("Shape",
827 {
828 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100829 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000830 })
831 {
832 }
833};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100834
Chunosovd6afedc2017-11-06 22:09:45 +0700835/** Data set containing small softmax layer shapes. */
836class SoftmaxLayerSmallShapes final : public ShapeDataset
837{
838public:
839 SoftmaxLayerSmallShapes()
840 : ShapeDataset("Shape",
841 {
842 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100843 TensorShape{ 256U, 10U },
844 TensorShape{ 353U, 8U },
845 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700846 })
847 {
848 }
849};
850
851/** Data set containing large softmax layer shapes. */
852class SoftmaxLayerLargeShapes final : public ShapeDataset
853{
854public:
855 SoftmaxLayerLargeShapes()
856 : ShapeDataset("Shape",
857 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000858 TensorShape{ 1000U, 10U }
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100859
860 })
861 {
862 }
863};
864
865/** Data set containing large and small softmax layer 4D shapes. */
866class SoftmaxLayer4DShapes final : public ShapeDataset
867{
868public:
869 SoftmaxLayer4DShapes()
870 : ShapeDataset("Shape",
871 {
872 TensorShape{ 9U, 9U, 9U, 9U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000873 TensorShape{ 31U, 10U, 1U, 9U },
Chunosovd6afedc2017-11-06 22:09:45 +0700874 })
875 {
876 }
877};
878
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000879/** Data set containing 2D tensor shapes relative to an image size. */
880class SmallImageShapes final : public ShapeDataset
881{
882public:
883 SmallImageShapes()
884 : ShapeDataset("Shape",
885 {
886 TensorShape{ 640U, 480U },
887 TensorShape{ 800U, 600U },
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000888 })
889 {
890 }
891};
892
893/** Data set containing 2D tensor shapes relative to an image size. */
894class LargeImageShapes final : public ShapeDataset
895{
896public:
897 LargeImageShapes()
898 : ShapeDataset("Shape",
899 {
900 TensorShape{ 1920U, 1080U },
901 TensorShape{ 2560U, 1536U },
902 TensorShape{ 3584U, 2048U }
903 })
904 {
905 }
906};
Giorgio Arena73023022018-09-04 14:55:55 +0100907
908/** Data set containing small YOLO tensor shapes. */
909class SmallYOLOShapes final : public ShapeDataset
910{
911public:
912 SmallYOLOShapes()
913 : ShapeDataset("Shape",
914 {
915 // Batch size 1
916 TensorShape{ 11U, 11U, 270U },
917 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100918 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100919 })
920 {
921 }
922};
923
924/** Data set containing large YOLO tensor shapes. */
925class LargeYOLOShapes final : public ShapeDataset
926{
927public:
928 LargeYOLOShapes()
929 : ShapeDataset("Shape",
930 {
931 TensorShape{ 24U, 23U, 270U },
932 TensorShape{ 51U, 63U, 90U, 2U },
933 TensorShape{ 76U, 91U, 45U, 3U }
934 })
935 {
936 }
937};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000938
939/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
940class SmallGEMMReshape2DShapes final : public ShapeDataset
941{
942public:
943 SmallGEMMReshape2DShapes()
944 : ShapeDataset("Shape",
945 {
946 TensorShape{ 63U, 72U },
947 })
948 {
949 }
950};
951
952/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
953class SmallGEMMReshape3DShapes final : public ShapeDataset
954{
955public:
956 SmallGEMMReshape3DShapes()
957 : ShapeDataset("Shape",
958 {
959 TensorShape{ 63U, 9U, 8U },
960 })
961 {
962 }
963};
964
965/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
966class LargeGEMMReshape2DShapes final : public ShapeDataset
967{
968public:
969 LargeGEMMReshape2DShapes()
970 : ShapeDataset("Shape",
971 {
972 TensorShape{ 16U, 27U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000973 TensorShape{ 345U, 171U }
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000974 })
975 {
976 }
977};
978
979/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
980class LargeGEMMReshape3DShapes final : public ShapeDataset
981{
982public:
983 LargeGEMMReshape3DShapes()
984 : ShapeDataset("Shape",
985 {
986 TensorShape{ 16U, 3U, 9U },
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000987 TensorShape{ 345U, 34U, 18U }
988 })
989 {
990 }
991};
Pablo Telloe96e4f02018-12-21 16:47:23 +0000992
993/** Data set containing small 2D tensor shapes. */
994class Small2DNonMaxSuppressionShapes final : public ShapeDataset
995{
996public:
997 Small2DNonMaxSuppressionShapes()
998 : ShapeDataset("Shape",
999 {
1000 TensorShape{ 4U, 7U },
1001 TensorShape{ 4U, 13U },
1002 TensorShape{ 4U, 64U }
1003 })
1004 {
1005 }
1006};
1007
1008/** Data set containing large 2D tensor shapes. */
1009class Large2DNonMaxSuppressionShapes final : public ShapeDataset
1010{
1011public:
1012 Large2DNonMaxSuppressionShapes()
1013 : ShapeDataset("Shape",
1014 {
Michalis Spyrou1d897772019-12-09 18:47:29 +00001015 TensorShape{ 4U, 113U }
Pablo Telloe96e4f02018-12-21 16:47:23 +00001016 })
1017 {
1018 }
1019};
1020
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001021} // namespace datasets
1022} // namespace test
1023} // namespace arm_compute
Michalis Spyrouf4643372019-11-29 16:17:13 +00001024#endif /* ARM_COMPUTE_TEST_SHAPE_DATASETS_H */