blob: ccd0756c2d192ea2563ba40b680949a669e0b149 [file] [log] [blame]
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2017-2020 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 },
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
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000159/** Data set containing tiny 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
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000193/** Data set containing pairs of tiny tensor shapes that are broadcast compatible. */
194class TinyShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
195{
196public:
197 TinyShapesBroadcast()
198 : ZipDataset<ShapeDataset, ShapeDataset>(
199 ShapeDataset("Shape0",
200 {
201 TensorShape{ 9U, 9U },
202 TensorShape{ 10U, 2U, 14U, 2U },
203 }),
204 ShapeDataset("Shape1",
205 {
206 TensorShape{ 9U, 1U, 9U },
207 TensorShape{ 10U },
208 }))
209 {
210 }
211};
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000212/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
213class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
214{
215public:
216 SmallShapesBroadcast()
217 : ZipDataset<ShapeDataset, ShapeDataset>(
218 ShapeDataset("Shape0",
219 {
220 TensorShape{ 9U, 9U },
221 TensorShape{ 27U, 13U, 2U },
222 TensorShape{ 128U, 1U, 5U, 3U },
223 TensorShape{ 9U, 9U, 3U, 4U },
224 TensorShape{ 27U, 13U, 2U, 4U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100225 TensorShape{ 1U, 1U, 1U, 5U },
226 TensorShape{ 1U, 16U, 10U, 2U, 128U },
227 TensorShape{ 1U, 16U, 10U, 2U, 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000228 }),
229 ShapeDataset("Shape1",
230 {
231 TensorShape{ 9U, 1U, 2U },
232 TensorShape{ 1U, 13U, 2U },
233 TensorShape{ 128U, 64U, 1U, 3U },
234 TensorShape{ 9U, 1U, 3U },
235 TensorShape{ 1U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100236 TensorShape{ 9U, 9U, 3U, 5U },
237 TensorShape{ 1U, 1U, 1U, 1U, 128U },
238 TensorShape{ 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000239 }))
240 {
241 }
242};
243
steniu01f81652d2017-09-11 15:29:12 +0100244/** Data set containing medium tensor shapes. */
245class MediumShapes final : public ShapeDataset
246{
247public:
248 MediumShapes()
249 : ShapeDataset("Shape",
250 {
251 // Batch size 1
252 TensorShape{ 37U, 37U },
253 TensorShape{ 27U, 33U, 2U },
steniu01f81652d2017-09-11 15:29:12 +0100254 // Arbitrary batch size
255 TensorShape{ 37U, 37U, 3U, 5U }
256 })
257 {
258 }
259};
260
Gian Marco37908d92017-11-07 14:38:22 +0000261/** Data set containing medium 2D tensor shapes. */
262class Medium2DShapes final : public ShapeDataset
263{
264public:
265 Medium2DShapes()
266 : ShapeDataset("Shape",
267 {
268 TensorShape{ 42U, 37U },
269 TensorShape{ 57U, 60U },
270 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100271 TensorShape{ 83U, 72U },
272 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000273 })
274 {
275 }
276};
277
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000278/** Data set containing medium 3D tensor shapes. */
279class Medium3DShapes final : public ShapeDataset
280{
281public:
282 Medium3DShapes()
283 : ShapeDataset("Shape",
284 {
285 TensorShape{ 42U, 37U, 8U },
286 TensorShape{ 57U, 60U, 13U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000287 TensorShape{ 83U, 72U, 14U }
288 })
289 {
290 }
291};
292
293/** Data set containing medium 4D tensor shapes. */
294class Medium4DShapes final : public ShapeDataset
295{
296public:
297 Medium4DShapes()
298 : ShapeDataset("Shape",
299 {
300 TensorShape{ 42U, 37U, 8U, 15U },
301 TensorShape{ 57U, 60U, 13U, 8U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000302 TensorShape{ 83U, 72U, 14U, 5U }
303 })
304 {
305 }
306};
307
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100308/** Data set containing large tensor shapes. */
309class LargeShapes final : public ShapeDataset
310{
311public:
312 LargeShapes()
313 : ShapeDataset("Shape",
314 {
Michalis Spyrou97b2bb12019-05-28 16:59:27 +0100315 TensorShape{ 582U, 131U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100316 })
317 {
318 }
319};
320
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000321/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
322class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
323{
324public:
325 LargeShapesBroadcast()
326 : ZipDataset<ShapeDataset, ShapeDataset>(
327 ShapeDataset("Shape0",
328 {
329 TensorShape{ 1921U, 541U },
330 TensorShape{ 1U, 485U, 2U, 3U },
331 TensorShape{ 4159U, 1U },
332 TensorShape{ 799U }
333 }),
334 ShapeDataset("Shape1",
335 {
336 TensorShape{ 1921U, 1U, 2U },
337 TensorShape{ 641U, 1U, 2U, 3U },
338 TensorShape{ 1U, 127U, 25U },
339 TensorShape{ 799U, 595U, 1U, 4U }
340 }))
341 {
342 }
343};
344
Gian Marco5420b282017-11-29 10:41:38 +0000345/** Data set containing large 1D tensor shapes. */
346class Large1DShapes final : public ShapeDataset
347{
348public:
349 Large1DShapes()
350 : ShapeDataset("Shape",
351 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000352 TensorShape{ 1245U }
Gian Marco5420b282017-11-29 10:41:38 +0000353 })
354 {
355 }
356};
357
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100358/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100359class Large2DShapes final : public ShapeDataset
360{
361public:
362 Large2DShapes()
363 : ShapeDataset("Shape",
364 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000365 TensorShape{ 1245U, 652U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100366 })
367 {
368 }
369};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100370
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100371/** Data set containing large 3D tensor shapes. */
372class Large3DShapes final : public ShapeDataset
373{
374public:
375 Large3DShapes()
376 : ShapeDataset("Shape",
377 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000378 TensorShape{ 320U, 240U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100379 })
380 {
381 }
382};
383
384/** Data set containing large 4D tensor shapes. */
385class Large4DShapes final : public ShapeDataset
386{
387public:
388 Large4DShapes()
389 : ShapeDataset("Shape",
390 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000391 TensorShape{ 320U, 123U, 3U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100392 })
393 {
394 }
395};
396
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000397/** Data set containing small 3x3 tensor shapes. */
398class Small3x3Shapes final : public ShapeDataset
399{
400public:
401 Small3x3Shapes()
402 : ShapeDataset("Shape",
403 {
404 TensorShape{ 3U, 3U, 7U, 4U },
405 TensorShape{ 3U, 3U, 4U, 13U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000406 TensorShape{ 3U, 3U, 3U, 5U },
407 })
408 {
409 }
410};
411
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100412/** Data set containing small 3x1 tensor shapes. */
413class Small3x1Shapes final : public ShapeDataset
414{
415public:
416 Small3x1Shapes()
417 : ShapeDataset("Shape",
418 {
419 TensorShape{ 3U, 1U, 7U, 4U },
420 TensorShape{ 3U, 1U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100421 TensorShape{ 3U, 1U, 3U, 5U },
422 })
423 {
424 }
425};
426
427/** Data set containing small 1x3 tensor shapes. */
428class Small1x3Shapes final : public ShapeDataset
429{
430public:
431 Small1x3Shapes()
432 : ShapeDataset("Shape",
433 {
434 TensorShape{ 1U, 3U, 7U, 4U },
435 TensorShape{ 1U, 3U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100436 TensorShape{ 1U, 3U, 3U, 5U },
437 })
438 {
439 }
440};
441
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000442/** Data set containing large 3x3 tensor shapes. */
443class Large3x3Shapes final : public ShapeDataset
444{
445public:
446 Large3x3Shapes()
447 : ShapeDataset("Shape",
448 {
449 TensorShape{ 3U, 3U, 32U, 64U },
450 TensorShape{ 3U, 3U, 51U, 13U },
451 TensorShape{ 3U, 3U, 53U, 47U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000452 })
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 },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100467 })
468 {
469 }
470};
471
472/** Data set containing large 1x3 tensor shapes. */
473class Large1x3Shapes final : public ShapeDataset
474{
475public:
476 Large1x3Shapes()
477 : ShapeDataset("Shape",
478 {
479 TensorShape{ 1U, 3U, 32U, 64U },
480 TensorShape{ 1U, 3U, 51U, 13U },
481 TensorShape{ 1U, 3U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100482 })
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 },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100496 TensorShape{ 5U, 5U, 3U, 5U },
497 })
498 {
499 }
500};
501
502/** Data set containing large 5x5 tensor shapes. */
503class Large5x5Shapes final : public ShapeDataset
504{
505public:
506 Large5x5Shapes()
507 : ShapeDataset("Shape",
508 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000509 TensorShape{ 5U, 5U, 32U, 64U }
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100510 })
511 {
512 }
513};
514
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100515/** Data set containing small 5x1 tensor shapes. */
516class Small5x1Shapes final : public ShapeDataset
517{
518public:
519 Small5x1Shapes()
520 : ShapeDataset("Shape",
521 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000522 TensorShape{ 5U, 1U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100523 })
524 {
525 }
526};
527
528/** Data set containing large 5x1 tensor shapes. */
529class Large5x1Shapes final : public ShapeDataset
530{
531public:
532 Large5x1Shapes()
533 : ShapeDataset("Shape",
534 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000535 TensorShape{ 5U, 1U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100536 })
537 {
538 }
539};
540
541/** Data set containing small 1x5 tensor shapes. */
542class Small1x5Shapes final : public ShapeDataset
543{
544public:
545 Small1x5Shapes()
546 : ShapeDataset("Shape",
547 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000548 TensorShape{ 1U, 5U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100549 })
550 {
551 }
552};
553
554/** Data set containing large 1x5 tensor shapes. */
555class Large1x5Shapes final : public ShapeDataset
556{
557public:
558 Large1x5Shapes()
559 : ShapeDataset("Shape",
560 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000561 TensorShape{ 1U, 5U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100562 })
563 {
564 }
565};
566
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000567/** Data set containing small 1x7 tensor shapes. */
568class Small1x7Shapes final : public ShapeDataset
569{
570public:
571 Small1x7Shapes()
572 : ShapeDataset("Shape",
573 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000574 TensorShape{ 1U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000575 })
576 {
577 }
578};
579
580/** Data set containing large 1x7 tensor shapes. */
581class Large1x7Shapes final : public ShapeDataset
582{
583public:
584 Large1x7Shapes()
585 : ShapeDataset("Shape",
586 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000587 TensorShape{ 1U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000588 })
589 {
590 }
591};
592
593/** Data set containing small 7x7 tensor shapes. */
594class Small7x7Shapes final : public ShapeDataset
595{
596public:
597 Small7x7Shapes()
598 : ShapeDataset("Shape",
599 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000600 TensorShape{ 7U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000601 })
602 {
603 }
604};
605
606/** Data set containing large 7x7 tensor shapes. */
607class Large7x7Shapes final : public ShapeDataset
608{
609public:
610 Large7x7Shapes()
611 : ShapeDataset("Shape",
612 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000613 TensorShape{ 7U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000614 })
615 {
616 }
617};
618
619/** Data set containing small 7x1 tensor shapes. */
620class Small7x1Shapes final : public ShapeDataset
621{
622public:
623 Small7x1Shapes()
624 : ShapeDataset("Shape",
625 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000626 TensorShape{ 7U, 1U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000627 })
628 {
629 }
630};
631
632/** Data set containing large 7x1 tensor shapes. */
633class Large7x1Shapes final : public ShapeDataset
634{
635public:
636 Large7x1Shapes()
637 : ShapeDataset("Shape",
638 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000639 TensorShape{ 7U, 1U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000640 })
641 {
642 }
643};
644
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100645/** Data set containing small tensor shapes for deconvolution. */
646class SmallDeconvolutionShapes final : public ShapeDataset
647{
648public:
649 SmallDeconvolutionShapes()
650 : ShapeDataset("InputShape",
651 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000652 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100653 TensorShape{ 5U, 5U, 3U },
654 TensorShape{ 11U, 13U, 4U, 3U }
655 })
656 {
657 }
658};
659
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000660/** Data set containing tiny tensor shapes for direct convolution. */
661class TinyDirectConvolutionShapes final : public ShapeDataset
662{
663public:
664 TinyDirectConvolutionShapes()
665 : ShapeDataset("InputShape",
666 {
667 // Batch size 1
668 TensorShape{ 11U, 13U, 3U },
669 TensorShape{ 7U, 27U, 3U }
670 })
671 {
672 }
673};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100674/** Data set containing small tensor shapes for direct convolution. */
675class SmallDirectConvolutionShapes final : public ShapeDataset
676{
677public:
678 SmallDirectConvolutionShapes()
679 : ShapeDataset("InputShape",
680 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100681 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100682 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100683 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100684 TensorShape{ 32U, 37U, 3U, 4U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100685 })
686 {
687 }
688};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100689
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800690/** Data set containing small tensor shapes for direct convolution. */
691class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
692{
693public:
694 SmallDirectConvolutionTensorShiftShapes()
695 : ShapeDataset("InputShape",
696 {
697 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100698 TensorShape{ 32U, 37U, 3U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800699 // Batch size 4
700 TensorShape{ 32U, 37U, 3U, 4U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800701 // Arbitrary batch size
702 TensorShape{ 32U, 37U, 3U, 8U }
703 })
704 {
705 }
706};
707
Giorgio Arena0f170392018-07-18 16:13:12 +0100708/** Data set containing small grouped im2col tensor shapes. */
709class GroupedIm2ColSmallShapes final : public ShapeDataset
710{
711public:
712 GroupedIm2ColSmallShapes()
713 : ShapeDataset("Shape",
714 {
715 TensorShape{ 11U, 11U, 48U },
716 TensorShape{ 27U, 13U, 24U },
717 TensorShape{ 128U, 64U, 12U, 3U },
718 TensorShape{ 11U, 11U, 48U, 4U },
719 TensorShape{ 27U, 13U, 24U, 4U },
720 TensorShape{ 11U, 11U, 48U, 5U }
721 })
722 {
723 }
724};
725
726/** Data set containing large grouped im2col tensor shapes. */
727class GroupedIm2ColLargeShapes final : public ShapeDataset
728{
729public:
730 GroupedIm2ColLargeShapes()
731 : ShapeDataset("Shape",
732 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100733 TensorShape{ 153U, 231U, 12U },
734 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100735 })
736 {
737 }
738};
739
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100740/** Data set containing small grouped weights tensor shapes. */
741class GroupedWeightsSmallShapes final : public ShapeDataset
742{
743public:
744 GroupedWeightsSmallShapes()
745 : ShapeDataset("Shape",
746 {
747 TensorShape{ 3U, 3U, 48U, 120U },
748 TensorShape{ 1U, 3U, 24U, 240U },
749 TensorShape{ 3U, 1U, 12U, 480U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000750 TensorShape{ 5U, 5U, 48U, 120U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100751 })
752 {
753 }
754};
755
756/** Data set containing large grouped weights tensor shapes. */
757class GroupedWeightsLargeShapes final : public ShapeDataset
758{
759public:
760 GroupedWeightsLargeShapes()
761 : ShapeDataset("Shape",
762 {
763 TensorShape{ 9U, 9U, 96U, 240U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000764 TensorShape{ 13U, 13U, 96U, 240U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100765 })
766 {
767 }
768};
769
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000770/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
771class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100772{
773public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000774 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100775 : ShapeDataset("Shape",
776 {
777 TensorShape{ 322U, 243U },
778 TensorShape{ 463U, 879U },
779 TensorShape{ 416U, 651U }
780 })
781 {
782 }
783};
784
Pablo Tello3dd5b682019-03-04 14:14:02 +0000785/** Data set containing tensor shapes for ConcatenateLayer. */
786class ConcatenateLayerShapes final : public ShapeDataset
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100787{
788public:
Pablo Tello3dd5b682019-03-04 14:14:02 +0000789 ConcatenateLayerShapes()
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100790 : ShapeDataset("Shape",
791 {
792 TensorShape{ 232U, 65U, 3U },
793 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100794 TensorShape{ 124U, 65U, 3U },
795 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100796 })
797 {
798 }
799};
800
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100801/** Data set containing global pooling tensor shapes. */
802class GlobalPoolingShapes final : public ShapeDataset
803{
804public:
805 GlobalPoolingShapes()
806 : ShapeDataset("Shape",
807 {
808 // Batch size 1
809 TensorShape{ 9U, 9U },
810 TensorShape{ 13U, 13U, 2U },
811 TensorShape{ 27U, 27U, 1U, 3U },
812 // Batch size 4
813 TensorShape{ 31U, 31U, 3U, 4U },
814 TensorShape{ 34U, 34U, 2U, 4U }
815 })
816 {
817 }
818};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000819/** Data set containing tiny softmax layer shapes. */
820class SoftmaxLayerTinyShapes final : public ShapeDataset
821{
822public:
823 SoftmaxLayerTinyShapes()
824 : ShapeDataset("Shape",
825 {
826 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100827 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000828 })
829 {
830 }
831};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100832
Chunosovd6afedc2017-11-06 22:09:45 +0700833/** Data set containing small softmax layer shapes. */
834class SoftmaxLayerSmallShapes final : public ShapeDataset
835{
836public:
837 SoftmaxLayerSmallShapes()
838 : ShapeDataset("Shape",
839 {
840 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100841 TensorShape{ 256U, 10U },
842 TensorShape{ 353U, 8U },
843 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700844 })
845 {
846 }
847};
848
849/** Data set containing large softmax layer shapes. */
850class SoftmaxLayerLargeShapes final : public ShapeDataset
851{
852public:
853 SoftmaxLayerLargeShapes()
854 : ShapeDataset("Shape",
855 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000856 TensorShape{ 1000U, 10U }
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100857
858 })
859 {
860 }
861};
862
863/** Data set containing large and small softmax layer 4D shapes. */
864class SoftmaxLayer4DShapes final : public ShapeDataset
865{
866public:
867 SoftmaxLayer4DShapes()
868 : ShapeDataset("Shape",
869 {
870 TensorShape{ 9U, 9U, 9U, 9U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000871 TensorShape{ 31U, 10U, 1U, 9U },
Chunosovd6afedc2017-11-06 22:09:45 +0700872 })
873 {
874 }
875};
876
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000877/** Data set containing 2D tensor shapes relative to an image size. */
878class SmallImageShapes final : public ShapeDataset
879{
880public:
881 SmallImageShapes()
882 : ShapeDataset("Shape",
883 {
884 TensorShape{ 640U, 480U },
885 TensorShape{ 800U, 600U },
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000886 })
887 {
888 }
889};
890
891/** Data set containing 2D tensor shapes relative to an image size. */
892class LargeImageShapes final : public ShapeDataset
893{
894public:
895 LargeImageShapes()
896 : ShapeDataset("Shape",
897 {
898 TensorShape{ 1920U, 1080U },
899 TensorShape{ 2560U, 1536U },
900 TensorShape{ 3584U, 2048U }
901 })
902 {
903 }
904};
Giorgio Arena73023022018-09-04 14:55:55 +0100905
906/** Data set containing small YOLO tensor shapes. */
907class SmallYOLOShapes final : public ShapeDataset
908{
909public:
910 SmallYOLOShapes()
911 : ShapeDataset("Shape",
912 {
913 // Batch size 1
914 TensorShape{ 11U, 11U, 270U },
915 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100916 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100917 })
918 {
919 }
920};
921
922/** Data set containing large YOLO tensor shapes. */
923class LargeYOLOShapes final : public ShapeDataset
924{
925public:
926 LargeYOLOShapes()
927 : ShapeDataset("Shape",
928 {
929 TensorShape{ 24U, 23U, 270U },
930 TensorShape{ 51U, 63U, 90U, 2U },
931 TensorShape{ 76U, 91U, 45U, 3U }
932 })
933 {
934 }
935};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000936
937/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
938class SmallGEMMReshape2DShapes final : public ShapeDataset
939{
940public:
941 SmallGEMMReshape2DShapes()
942 : ShapeDataset("Shape",
943 {
944 TensorShape{ 63U, 72U },
945 })
946 {
947 }
948};
949
950/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
951class SmallGEMMReshape3DShapes final : public ShapeDataset
952{
953public:
954 SmallGEMMReshape3DShapes()
955 : ShapeDataset("Shape",
956 {
957 TensorShape{ 63U, 9U, 8U },
958 })
959 {
960 }
961};
962
963/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
964class LargeGEMMReshape2DShapes final : public ShapeDataset
965{
966public:
967 LargeGEMMReshape2DShapes()
968 : ShapeDataset("Shape",
969 {
970 TensorShape{ 16U, 27U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000971 TensorShape{ 345U, 171U }
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000972 })
973 {
974 }
975};
976
977/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
978class LargeGEMMReshape3DShapes final : public ShapeDataset
979{
980public:
981 LargeGEMMReshape3DShapes()
982 : ShapeDataset("Shape",
983 {
984 TensorShape{ 16U, 3U, 9U },
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000985 TensorShape{ 345U, 34U, 18U }
986 })
987 {
988 }
989};
Pablo Telloe96e4f02018-12-21 16:47:23 +0000990
991/** Data set containing small 2D tensor shapes. */
992class Small2DNonMaxSuppressionShapes final : public ShapeDataset
993{
994public:
995 Small2DNonMaxSuppressionShapes()
996 : ShapeDataset("Shape",
997 {
998 TensorShape{ 4U, 7U },
999 TensorShape{ 4U, 13U },
1000 TensorShape{ 4U, 64U }
1001 })
1002 {
1003 }
1004};
1005
1006/** Data set containing large 2D tensor shapes. */
1007class Large2DNonMaxSuppressionShapes final : public ShapeDataset
1008{
1009public:
1010 Large2DNonMaxSuppressionShapes()
1011 : ShapeDataset("Shape",
1012 {
Michalis Spyrou1d897772019-12-09 18:47:29 +00001013 TensorShape{ 4U, 113U }
Pablo Telloe96e4f02018-12-21 16:47:23 +00001014 })
1015 {
1016 }
1017};
1018
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001019} // namespace datasets
1020} // namespace test
1021} // namespace arm_compute
Michalis Spyrouf4643372019-11-29 16:17:13 +00001022#endif /* ARM_COMPUTE_TEST_SHAPE_DATASETS_H */