blob: f3ef2c298511e458fd59ce9762de19d066eb72fe [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 {
Giorgio Arenaed4b8a02021-05-12 12:28:58 +010091 TensorShape{ 1U, 7U },
92 TensorShape{ 5U, 13U },
93 TensorShape{ 32U, 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
Giorgio Arenafd83bc82021-05-12 12:44:47 +0100168 TensorShape{ 1U, 9U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000169 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};
Sheri Zhanga387e272021-06-29 17:34:06 +0100214/** Data set containing pairs of tiny tensor shapes that are broadcast compatible and can do in_place calculation. */
215class TinyShapesBroadcastInplace final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
216{
217public:
218 TinyShapesBroadcastInplace()
219 : ZipDataset<ShapeDataset, ShapeDataset>(
220 ShapeDataset("Shape0",
221 {
222 TensorShape{ 9U },
223 TensorShape{ 10U, 2U, 14U, 2U },
224 }),
225 ShapeDataset("Shape1",
226 {
227 TensorShape{ 9U, 1U, 9U },
228 TensorShape{ 10U },
229 }))
230 {
231 }
232};
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000233/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
234class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
235{
236public:
237 SmallShapesBroadcast()
238 : ZipDataset<ShapeDataset, ShapeDataset>(
239 ShapeDataset("Shape0",
240 {
241 TensorShape{ 9U, 9U },
242 TensorShape{ 27U, 13U, 2U },
243 TensorShape{ 128U, 1U, 5U, 3U },
244 TensorShape{ 9U, 9U, 3U, 4U },
245 TensorShape{ 27U, 13U, 2U, 4U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100246 TensorShape{ 1U, 1U, 1U, 5U },
247 TensorShape{ 1U, 16U, 10U, 2U, 128U },
248 TensorShape{ 1U, 16U, 10U, 2U, 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000249 }),
250 ShapeDataset("Shape1",
251 {
252 TensorShape{ 9U, 1U, 2U },
253 TensorShape{ 1U, 13U, 2U },
254 TensorShape{ 128U, 64U, 1U, 3U },
255 TensorShape{ 9U, 1U, 3U },
256 TensorShape{ 1U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100257 TensorShape{ 9U, 9U, 3U, 5U },
258 TensorShape{ 1U, 1U, 1U, 1U, 128U },
259 TensorShape{ 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000260 }))
261 {
262 }
263};
264
steniu01f81652d2017-09-11 15:29:12 +0100265/** Data set containing medium tensor shapes. */
266class MediumShapes final : public ShapeDataset
267{
268public:
269 MediumShapes()
270 : ShapeDataset("Shape",
271 {
272 // Batch size 1
273 TensorShape{ 37U, 37U },
274 TensorShape{ 27U, 33U, 2U },
steniu01f81652d2017-09-11 15:29:12 +0100275 // Arbitrary batch size
276 TensorShape{ 37U, 37U, 3U, 5U }
277 })
278 {
279 }
280};
281
Gian Marco37908d92017-11-07 14:38:22 +0000282/** Data set containing medium 2D tensor shapes. */
283class Medium2DShapes final : public ShapeDataset
284{
285public:
286 Medium2DShapes()
287 : ShapeDataset("Shape",
288 {
289 TensorShape{ 42U, 37U },
290 TensorShape{ 57U, 60U },
291 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100292 TensorShape{ 83U, 72U },
293 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000294 })
295 {
296 }
297};
298
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000299/** Data set containing medium 3D tensor shapes. */
300class Medium3DShapes final : public ShapeDataset
301{
302public:
303 Medium3DShapes()
304 : ShapeDataset("Shape",
305 {
306 TensorShape{ 42U, 37U, 8U },
307 TensorShape{ 57U, 60U, 13U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000308 TensorShape{ 83U, 72U, 14U }
309 })
310 {
311 }
312};
313
314/** Data set containing medium 4D tensor shapes. */
315class Medium4DShapes final : public ShapeDataset
316{
317public:
318 Medium4DShapes()
319 : ShapeDataset("Shape",
320 {
321 TensorShape{ 42U, 37U, 8U, 15U },
322 TensorShape{ 57U, 60U, 13U, 8U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000323 TensorShape{ 83U, 72U, 14U, 5U }
324 })
325 {
326 }
327};
328
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100329/** Data set containing large tensor shapes. */
330class LargeShapes final : public ShapeDataset
331{
332public:
333 LargeShapes()
334 : ShapeDataset("Shape",
335 {
Michalis Spyrou97b2bb12019-05-28 16:59:27 +0100336 TensorShape{ 582U, 131U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100337 })
338 {
339 }
340};
341
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000342/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
343class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
344{
345public:
346 LargeShapesBroadcast()
347 : ZipDataset<ShapeDataset, ShapeDataset>(
348 ShapeDataset("Shape0",
349 {
350 TensorShape{ 1921U, 541U },
351 TensorShape{ 1U, 485U, 2U, 3U },
352 TensorShape{ 4159U, 1U },
353 TensorShape{ 799U }
354 }),
355 ShapeDataset("Shape1",
356 {
357 TensorShape{ 1921U, 1U, 2U },
358 TensorShape{ 641U, 1U, 2U, 3U },
359 TensorShape{ 1U, 127U, 25U },
360 TensorShape{ 799U, 595U, 1U, 4U }
361 }))
362 {
363 }
364};
365
Gian Marco5420b282017-11-29 10:41:38 +0000366/** Data set containing large 1D tensor shapes. */
367class Large1DShapes final : public ShapeDataset
368{
369public:
370 Large1DShapes()
371 : ShapeDataset("Shape",
372 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000373 TensorShape{ 1245U }
Gian Marco5420b282017-11-29 10:41:38 +0000374 })
375 {
376 }
377};
378
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100379/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100380class Large2DShapes final : public ShapeDataset
381{
382public:
383 Large2DShapes()
384 : ShapeDataset("Shape",
385 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000386 TensorShape{ 1245U, 652U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100387 })
388 {
389 }
390};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100391
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100392/** Data set containing large 3D tensor shapes. */
393class Large3DShapes final : public ShapeDataset
394{
395public:
396 Large3DShapes()
397 : ShapeDataset("Shape",
398 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000399 TensorShape{ 320U, 240U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100400 })
401 {
402 }
403};
404
405/** Data set containing large 4D tensor shapes. */
406class Large4DShapes final : public ShapeDataset
407{
408public:
409 Large4DShapes()
410 : ShapeDataset("Shape",
411 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000412 TensorShape{ 320U, 123U, 3U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100413 })
414 {
415 }
416};
417
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000418/** Data set containing small 3x3 tensor shapes. */
419class Small3x3Shapes final : public ShapeDataset
420{
421public:
422 Small3x3Shapes()
423 : ShapeDataset("Shape",
424 {
425 TensorShape{ 3U, 3U, 7U, 4U },
426 TensorShape{ 3U, 3U, 4U, 13U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000427 TensorShape{ 3U, 3U, 3U, 5U },
428 })
429 {
430 }
431};
432
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100433/** Data set containing small 3x1 tensor shapes. */
434class Small3x1Shapes final : public ShapeDataset
435{
436public:
437 Small3x1Shapes()
438 : ShapeDataset("Shape",
439 {
440 TensorShape{ 3U, 1U, 7U, 4U },
441 TensorShape{ 3U, 1U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100442 TensorShape{ 3U, 1U, 3U, 5U },
443 })
444 {
445 }
446};
447
448/** Data set containing small 1x3 tensor shapes. */
449class Small1x3Shapes final : public ShapeDataset
450{
451public:
452 Small1x3Shapes()
453 : ShapeDataset("Shape",
454 {
455 TensorShape{ 1U, 3U, 7U, 4U },
456 TensorShape{ 1U, 3U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100457 TensorShape{ 1U, 3U, 3U, 5U },
458 })
459 {
460 }
461};
462
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000463/** Data set containing large 3x3 tensor shapes. */
464class Large3x3Shapes final : public ShapeDataset
465{
466public:
467 Large3x3Shapes()
468 : ShapeDataset("Shape",
469 {
470 TensorShape{ 3U, 3U, 32U, 64U },
471 TensorShape{ 3U, 3U, 51U, 13U },
472 TensorShape{ 3U, 3U, 53U, 47U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000473 })
474 {
475 }
476};
477
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100478/** Data set containing large 3x1 tensor shapes. */
479class Large3x1Shapes final : public ShapeDataset
480{
481public:
482 Large3x1Shapes()
483 : ShapeDataset("Shape",
484 {
485 TensorShape{ 3U, 1U, 32U, 64U },
486 TensorShape{ 3U, 1U, 51U, 13U },
487 TensorShape{ 3U, 1U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100488 })
489 {
490 }
491};
492
493/** Data set containing large 1x3 tensor shapes. */
494class Large1x3Shapes final : public ShapeDataset
495{
496public:
497 Large1x3Shapes()
498 : ShapeDataset("Shape",
499 {
500 TensorShape{ 1U, 3U, 32U, 64U },
501 TensorShape{ 1U, 3U, 51U, 13U },
502 TensorShape{ 1U, 3U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100503 })
504 {
505 }
506};
507
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100508/** Data set containing small 5x5 tensor shapes. */
509class Small5x5Shapes final : public ShapeDataset
510{
511public:
512 Small5x5Shapes()
513 : ShapeDataset("Shape",
514 {
515 TensorShape{ 5U, 5U, 7U, 4U },
516 TensorShape{ 5U, 5U, 4U, 13U },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100517 TensorShape{ 5U, 5U, 3U, 5U },
518 })
519 {
520 }
521};
522
523/** Data set containing large 5x5 tensor shapes. */
524class Large5x5Shapes final : public ShapeDataset
525{
526public:
527 Large5x5Shapes()
528 : ShapeDataset("Shape",
529 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000530 TensorShape{ 5U, 5U, 32U, 64U }
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100531 })
532 {
533 }
534};
535
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100536/** Data set containing small 5x1 tensor shapes. */
537class Small5x1Shapes final : public ShapeDataset
538{
539public:
540 Small5x1Shapes()
541 : ShapeDataset("Shape",
542 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000543 TensorShape{ 5U, 1U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100544 })
545 {
546 }
547};
548
549/** Data set containing large 5x1 tensor shapes. */
550class Large5x1Shapes final : public ShapeDataset
551{
552public:
553 Large5x1Shapes()
554 : ShapeDataset("Shape",
555 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000556 TensorShape{ 5U, 1U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100557 })
558 {
559 }
560};
561
562/** Data set containing small 1x5 tensor shapes. */
563class Small1x5Shapes final : public ShapeDataset
564{
565public:
566 Small1x5Shapes()
567 : ShapeDataset("Shape",
568 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000569 TensorShape{ 1U, 5U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100570 })
571 {
572 }
573};
574
575/** Data set containing large 1x5 tensor shapes. */
576class Large1x5Shapes final : public ShapeDataset
577{
578public:
579 Large1x5Shapes()
580 : ShapeDataset("Shape",
581 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000582 TensorShape{ 1U, 5U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100583 })
584 {
585 }
586};
587
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000588/** Data set containing small 1x7 tensor shapes. */
589class Small1x7Shapes final : public ShapeDataset
590{
591public:
592 Small1x7Shapes()
593 : ShapeDataset("Shape",
594 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000595 TensorShape{ 1U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000596 })
597 {
598 }
599};
600
601/** Data set containing large 1x7 tensor shapes. */
602class Large1x7Shapes final : public ShapeDataset
603{
604public:
605 Large1x7Shapes()
606 : ShapeDataset("Shape",
607 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000608 TensorShape{ 1U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000609 })
610 {
611 }
612};
613
614/** Data set containing small 7x7 tensor shapes. */
615class Small7x7Shapes final : public ShapeDataset
616{
617public:
618 Small7x7Shapes()
619 : ShapeDataset("Shape",
620 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000621 TensorShape{ 7U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000622 })
623 {
624 }
625};
626
627/** Data set containing large 7x7 tensor shapes. */
628class Large7x7Shapes final : public ShapeDataset
629{
630public:
631 Large7x7Shapes()
632 : ShapeDataset("Shape",
633 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000634 TensorShape{ 7U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000635 })
636 {
637 }
638};
639
640/** Data set containing small 7x1 tensor shapes. */
641class Small7x1Shapes final : public ShapeDataset
642{
643public:
644 Small7x1Shapes()
645 : ShapeDataset("Shape",
646 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000647 TensorShape{ 7U, 1U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000648 })
649 {
650 }
651};
652
653/** Data set containing large 7x1 tensor shapes. */
654class Large7x1Shapes final : public ShapeDataset
655{
656public:
657 Large7x1Shapes()
658 : ShapeDataset("Shape",
659 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000660 TensorShape{ 7U, 1U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000661 })
662 {
663 }
664};
665
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100666/** Data set containing small tensor shapes for deconvolution. */
667class SmallDeconvolutionShapes final : public ShapeDataset
668{
669public:
670 SmallDeconvolutionShapes()
671 : ShapeDataset("InputShape",
672 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000673 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100674 TensorShape{ 5U, 5U, 3U },
675 TensorShape{ 11U, 13U, 4U, 3U }
676 })
677 {
678 }
679};
680
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000681/** Data set containing tiny tensor shapes for direct convolution. */
682class TinyDirectConvolutionShapes final : public ShapeDataset
683{
684public:
685 TinyDirectConvolutionShapes()
686 : ShapeDataset("InputShape",
687 {
688 // Batch size 1
689 TensorShape{ 11U, 13U, 3U },
690 TensorShape{ 7U, 27U, 3U }
691 })
692 {
693 }
694};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100695/** Data set containing small tensor shapes for direct convolution. */
696class SmallDirectConvolutionShapes final : public ShapeDataset
697{
698public:
699 SmallDirectConvolutionShapes()
700 : ShapeDataset("InputShape",
701 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100702 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100703 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100704 // Batch size 4
Gian Marco Iodice0841ca02021-02-01 14:37:02 +0000705 TensorShape{ 6U, 9U, 5U, 4U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100706 })
707 {
708 }
709};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100710
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800711/** Data set containing small tensor shapes for direct convolution. */
712class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
713{
714public:
715 SmallDirectConvolutionTensorShiftShapes()
716 : ShapeDataset("InputShape",
717 {
718 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100719 TensorShape{ 32U, 37U, 3U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800720 // Batch size 4
721 TensorShape{ 32U, 37U, 3U, 4U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800722 // Arbitrary batch size
723 TensorShape{ 32U, 37U, 3U, 8U }
724 })
725 {
726 }
727};
728
Giorgio Arena0f170392018-07-18 16:13:12 +0100729/** Data set containing small grouped im2col tensor shapes. */
730class GroupedIm2ColSmallShapes final : public ShapeDataset
731{
732public:
733 GroupedIm2ColSmallShapes()
734 : ShapeDataset("Shape",
735 {
736 TensorShape{ 11U, 11U, 48U },
737 TensorShape{ 27U, 13U, 24U },
738 TensorShape{ 128U, 64U, 12U, 3U },
739 TensorShape{ 11U, 11U, 48U, 4U },
740 TensorShape{ 27U, 13U, 24U, 4U },
741 TensorShape{ 11U, 11U, 48U, 5U }
742 })
743 {
744 }
745};
746
747/** Data set containing large grouped im2col tensor shapes. */
748class GroupedIm2ColLargeShapes final : public ShapeDataset
749{
750public:
751 GroupedIm2ColLargeShapes()
752 : ShapeDataset("Shape",
753 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100754 TensorShape{ 153U, 231U, 12U },
755 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100756 })
757 {
758 }
759};
760
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100761/** Data set containing small grouped weights tensor shapes. */
762class GroupedWeightsSmallShapes final : public ShapeDataset
763{
764public:
765 GroupedWeightsSmallShapes()
766 : ShapeDataset("Shape",
767 {
768 TensorShape{ 3U, 3U, 48U, 120U },
769 TensorShape{ 1U, 3U, 24U, 240U },
770 TensorShape{ 3U, 1U, 12U, 480U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000771 TensorShape{ 5U, 5U, 48U, 120U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100772 })
773 {
774 }
775};
776
777/** Data set containing large grouped weights tensor shapes. */
778class GroupedWeightsLargeShapes final : public ShapeDataset
779{
780public:
781 GroupedWeightsLargeShapes()
782 : ShapeDataset("Shape",
783 {
784 TensorShape{ 9U, 9U, 96U, 240U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000785 TensorShape{ 13U, 13U, 96U, 240U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100786 })
787 {
788 }
789};
790
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000791/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
792class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100793{
794public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000795 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100796 : ShapeDataset("Shape",
797 {
798 TensorShape{ 322U, 243U },
799 TensorShape{ 463U, 879U },
800 TensorShape{ 416U, 651U }
801 })
802 {
803 }
804};
805
Pablo Tello3dd5b682019-03-04 14:14:02 +0000806/** Data set containing tensor shapes for ConcatenateLayer. */
807class ConcatenateLayerShapes final : public ShapeDataset
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100808{
809public:
Pablo Tello3dd5b682019-03-04 14:14:02 +0000810 ConcatenateLayerShapes()
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100811 : ShapeDataset("Shape",
812 {
813 TensorShape{ 232U, 65U, 3U },
814 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100815 TensorShape{ 124U, 65U, 3U },
816 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100817 })
818 {
819 }
820};
821
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100822/** Data set containing global pooling tensor shapes. */
823class GlobalPoolingShapes final : public ShapeDataset
824{
825public:
826 GlobalPoolingShapes()
827 : ShapeDataset("Shape",
828 {
829 // Batch size 1
830 TensorShape{ 9U, 9U },
831 TensorShape{ 13U, 13U, 2U },
832 TensorShape{ 27U, 27U, 1U, 3U },
833 // Batch size 4
834 TensorShape{ 31U, 31U, 3U, 4U },
835 TensorShape{ 34U, 34U, 2U, 4U }
836 })
837 {
838 }
839};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000840/** Data set containing tiny softmax layer shapes. */
841class SoftmaxLayerTinyShapes final : public ShapeDataset
842{
843public:
844 SoftmaxLayerTinyShapes()
845 : ShapeDataset("Shape",
846 {
847 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100848 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000849 })
850 {
851 }
852};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100853
Chunosovd6afedc2017-11-06 22:09:45 +0700854/** Data set containing small softmax layer shapes. */
855class SoftmaxLayerSmallShapes final : public ShapeDataset
856{
857public:
858 SoftmaxLayerSmallShapes()
859 : ShapeDataset("Shape",
860 {
SiCong Li37d65e42020-11-06 09:55:04 +0000861 TensorShape{ 1U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100862 TensorShape{ 256U, 10U },
863 TensorShape{ 353U, 8U },
864 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700865 })
866 {
867 }
868};
869
870/** Data set containing large softmax layer shapes. */
871class SoftmaxLayerLargeShapes final : public ShapeDataset
872{
873public:
874 SoftmaxLayerLargeShapes()
875 : ShapeDataset("Shape",
876 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000877 TensorShape{ 1000U, 10U }
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100878
879 })
880 {
881 }
882};
883
884/** Data set containing large and small softmax layer 4D shapes. */
885class SoftmaxLayer4DShapes final : public ShapeDataset
886{
887public:
888 SoftmaxLayer4DShapes()
889 : ShapeDataset("Shape",
890 {
891 TensorShape{ 9U, 9U, 9U, 9U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000892 TensorShape{ 31U, 10U, 1U, 9U },
Chunosovd6afedc2017-11-06 22:09:45 +0700893 })
894 {
895 }
896};
897
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000898/** Data set containing 2D tensor shapes relative to an image size. */
899class SmallImageShapes final : public ShapeDataset
900{
901public:
902 SmallImageShapes()
903 : ShapeDataset("Shape",
904 {
905 TensorShape{ 640U, 480U },
906 TensorShape{ 800U, 600U },
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000907 })
908 {
909 }
910};
911
912/** Data set containing 2D tensor shapes relative to an image size. */
913class LargeImageShapes final : public ShapeDataset
914{
915public:
916 LargeImageShapes()
917 : ShapeDataset("Shape",
918 {
919 TensorShape{ 1920U, 1080U },
920 TensorShape{ 2560U, 1536U },
921 TensorShape{ 3584U, 2048U }
922 })
923 {
924 }
925};
Giorgio Arena73023022018-09-04 14:55:55 +0100926
927/** Data set containing small YOLO tensor shapes. */
928class SmallYOLOShapes final : public ShapeDataset
929{
930public:
931 SmallYOLOShapes()
932 : ShapeDataset("Shape",
933 {
934 // Batch size 1
935 TensorShape{ 11U, 11U, 270U },
936 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100937 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100938 })
939 {
940 }
941};
942
943/** Data set containing large YOLO tensor shapes. */
944class LargeYOLOShapes final : public ShapeDataset
945{
946public:
947 LargeYOLOShapes()
948 : ShapeDataset("Shape",
949 {
950 TensorShape{ 24U, 23U, 270U },
951 TensorShape{ 51U, 63U, 90U, 2U },
952 TensorShape{ 76U, 91U, 45U, 3U }
953 })
954 {
955 }
956};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000957
958/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
959class SmallGEMMReshape2DShapes final : public ShapeDataset
960{
961public:
962 SmallGEMMReshape2DShapes()
963 : ShapeDataset("Shape",
964 {
965 TensorShape{ 63U, 72U },
966 })
967 {
968 }
969};
970
971/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
972class SmallGEMMReshape3DShapes final : public ShapeDataset
973{
974public:
975 SmallGEMMReshape3DShapes()
976 : ShapeDataset("Shape",
977 {
978 TensorShape{ 63U, 9U, 8U },
979 })
980 {
981 }
982};
983
984/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
985class LargeGEMMReshape2DShapes final : public ShapeDataset
986{
987public:
988 LargeGEMMReshape2DShapes()
989 : ShapeDataset("Shape",
990 {
991 TensorShape{ 16U, 27U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000992 TensorShape{ 345U, 171U }
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000993 })
994 {
995 }
996};
997
998/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
999class LargeGEMMReshape3DShapes final : public ShapeDataset
1000{
1001public:
1002 LargeGEMMReshape3DShapes()
1003 : ShapeDataset("Shape",
1004 {
1005 TensorShape{ 16U, 3U, 9U },
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +00001006 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 {
Michalis Spyrou1d897772019-12-09 18:47:29 +00001034 TensorShape{ 4U, 113U }
Pablo Telloe96e4f02018-12-21 16:47:23 +00001035 })
1036 {
1037 }
1038};
1039
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001040} // namespace datasets
1041} // namespace test
1042} // namespace arm_compute
Michalis Spyrouf4643372019-11-29 16:17:13 +00001043#endif /* ARM_COMPUTE_TEST_SHAPE_DATASETS_H */