blob: 2a2047480f079b184c7afa6bc0833a1154bd2e1d [file] [log] [blame]
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001/*
Michalis Spyrou80943252019-01-10 17:19:50 +00002 * Copyright (c) 2017-2019 ARM Limited.
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
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
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100159/** Data set containing small tensor shapes. */
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000160class TinyShapes final : public ShapeDataset
161{
162public:
163 TinyShapes()
164 : ShapeDataset("Shape",
165 {
166 // Batch size 1
167 TensorShape{ 9U, 9U },
168 TensorShape{ 27U, 13U, 2U },
169 })
170 {
171 }
172};
173/** Data set containing small tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100174class SmallShapes final : public ShapeDataset
175{
176public:
177 SmallShapes()
178 : ShapeDataset("Shape",
179 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100180 // Batch size 1
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100181 TensorShape{ 11U, 11U },
Georgios Pinitas64f1a902018-09-18 13:42:51 +0100182 TensorShape{ 27U, 13U, 7U },
183 TensorShape{ 31U, 27U, 17U, 2U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100184 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100185 TensorShape{ 27U, 13U, 2U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100186 // Arbitrary batch size
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100187 TensorShape{ 11U, 11U, 3U, 5U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100188 })
189 {
190 }
191};
192
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000193/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
194class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
195{
196public:
197 SmallShapesBroadcast()
198 : ZipDataset<ShapeDataset, ShapeDataset>(
199 ShapeDataset("Shape0",
200 {
201 TensorShape{ 9U, 9U },
202 TensorShape{ 27U, 13U, 2U },
203 TensorShape{ 128U, 1U, 5U, 3U },
204 TensorShape{ 9U, 9U, 3U, 4U },
205 TensorShape{ 27U, 13U, 2U, 4U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100206 TensorShape{ 1U, 1U, 1U, 5U },
207 TensorShape{ 1U, 16U, 10U, 2U, 128U },
208 TensorShape{ 1U, 16U, 10U, 2U, 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000209 }),
210 ShapeDataset("Shape1",
211 {
212 TensorShape{ 9U, 1U, 2U },
213 TensorShape{ 1U, 13U, 2U },
214 TensorShape{ 128U, 64U, 1U, 3U },
215 TensorShape{ 9U, 1U, 3U },
216 TensorShape{ 1U },
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100217 TensorShape{ 9U, 9U, 3U, 5U },
218 TensorShape{ 1U, 1U, 1U, 1U, 128U },
219 TensorShape{ 128U }
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000220 }))
221 {
222 }
223};
224
steniu01f81652d2017-09-11 15:29:12 +0100225/** Data set containing medium tensor shapes. */
226class MediumShapes final : public ShapeDataset
227{
228public:
229 MediumShapes()
230 : ShapeDataset("Shape",
231 {
232 // Batch size 1
233 TensorShape{ 37U, 37U },
234 TensorShape{ 27U, 33U, 2U },
steniu01f81652d2017-09-11 15:29:12 +0100235 // Arbitrary batch size
236 TensorShape{ 37U, 37U, 3U, 5U }
237 })
238 {
239 }
240};
241
Gian Marco37908d92017-11-07 14:38:22 +0000242/** Data set containing medium 2D tensor shapes. */
243class Medium2DShapes final : public ShapeDataset
244{
245public:
246 Medium2DShapes()
247 : ShapeDataset("Shape",
248 {
249 TensorShape{ 42U, 37U },
250 TensorShape{ 57U, 60U },
251 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100252 TensorShape{ 83U, 72U },
253 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000254 })
255 {
256 }
257};
258
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000259/** Data set containing medium 3D tensor shapes. */
260class Medium3DShapes final : public ShapeDataset
261{
262public:
263 Medium3DShapes()
264 : ShapeDataset("Shape",
265 {
266 TensorShape{ 42U, 37U, 8U },
267 TensorShape{ 57U, 60U, 13U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000268 TensorShape{ 83U, 72U, 14U }
269 })
270 {
271 }
272};
273
274/** Data set containing medium 4D tensor shapes. */
275class Medium4DShapes final : public ShapeDataset
276{
277public:
278 Medium4DShapes()
279 : ShapeDataset("Shape",
280 {
281 TensorShape{ 42U, 37U, 8U, 15U },
282 TensorShape{ 57U, 60U, 13U, 8U },
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000283 TensorShape{ 83U, 72U, 14U, 5U }
284 })
285 {
286 }
287};
288
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100289/** Data set containing large tensor shapes. */
290class LargeShapes final : public ShapeDataset
291{
292public:
293 LargeShapes()
294 : ShapeDataset("Shape",
295 {
Michalis Spyrou97b2bb12019-05-28 16:59:27 +0100296 TensorShape{ 582U, 131U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100297 })
298 {
299 }
300};
301
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000302/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
303class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
304{
305public:
306 LargeShapesBroadcast()
307 : ZipDataset<ShapeDataset, ShapeDataset>(
308 ShapeDataset("Shape0",
309 {
310 TensorShape{ 1921U, 541U },
311 TensorShape{ 1U, 485U, 2U, 3U },
312 TensorShape{ 4159U, 1U },
313 TensorShape{ 799U }
314 }),
315 ShapeDataset("Shape1",
316 {
317 TensorShape{ 1921U, 1U, 2U },
318 TensorShape{ 641U, 1U, 2U, 3U },
319 TensorShape{ 1U, 127U, 25U },
320 TensorShape{ 799U, 595U, 1U, 4U }
321 }))
322 {
323 }
324};
325
Gian Marco5420b282017-11-29 10:41:38 +0000326/** Data set containing large 1D tensor shapes. */
327class Large1DShapes final : public ShapeDataset
328{
329public:
330 Large1DShapes()
331 : ShapeDataset("Shape",
332 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000333 TensorShape{ 1245U }
Gian Marco5420b282017-11-29 10:41:38 +0000334 })
335 {
336 }
337};
338
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100339/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100340class Large2DShapes final : public ShapeDataset
341{
342public:
343 Large2DShapes()
344 : ShapeDataset("Shape",
345 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000346 TensorShape{ 1245U, 652U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100347 })
348 {
349 }
350};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100351
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100352/** Data set containing large 3D tensor shapes. */
353class Large3DShapes final : public ShapeDataset
354{
355public:
356 Large3DShapes()
357 : ShapeDataset("Shape",
358 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000359 TensorShape{ 320U, 240U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100360 })
361 {
362 }
363};
364
365/** Data set containing large 4D tensor shapes. */
366class Large4DShapes final : public ShapeDataset
367{
368public:
369 Large4DShapes()
370 : ShapeDataset("Shape",
371 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000372 TensorShape{ 320U, 123U, 3U, 3U }
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100373 })
374 {
375 }
376};
377
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000378/** Data set containing small 3x3 tensor shapes. */
379class Small3x3Shapes final : public ShapeDataset
380{
381public:
382 Small3x3Shapes()
383 : ShapeDataset("Shape",
384 {
385 TensorShape{ 3U, 3U, 7U, 4U },
386 TensorShape{ 3U, 3U, 4U, 13U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000387 TensorShape{ 3U, 3U, 3U, 5U },
388 })
389 {
390 }
391};
392
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100393/** Data set containing small 3x1 tensor shapes. */
394class Small3x1Shapes final : public ShapeDataset
395{
396public:
397 Small3x1Shapes()
398 : ShapeDataset("Shape",
399 {
400 TensorShape{ 3U, 1U, 7U, 4U },
401 TensorShape{ 3U, 1U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100402 TensorShape{ 3U, 1U, 3U, 5U },
403 })
404 {
405 }
406};
407
408/** Data set containing small 1x3 tensor shapes. */
409class Small1x3Shapes final : public ShapeDataset
410{
411public:
412 Small1x3Shapes()
413 : ShapeDataset("Shape",
414 {
415 TensorShape{ 1U, 3U, 7U, 4U },
416 TensorShape{ 1U, 3U, 4U, 13U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100417 TensorShape{ 1U, 3U, 3U, 5U },
418 })
419 {
420 }
421};
422
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000423/** Data set containing large 3x3 tensor shapes. */
424class Large3x3Shapes final : public ShapeDataset
425{
426public:
427 Large3x3Shapes()
428 : ShapeDataset("Shape",
429 {
430 TensorShape{ 3U, 3U, 32U, 64U },
431 TensorShape{ 3U, 3U, 51U, 13U },
432 TensorShape{ 3U, 3U, 53U, 47U },
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000433 })
434 {
435 }
436};
437
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100438/** Data set containing large 3x1 tensor shapes. */
439class Large3x1Shapes final : public ShapeDataset
440{
441public:
442 Large3x1Shapes()
443 : ShapeDataset("Shape",
444 {
445 TensorShape{ 3U, 1U, 32U, 64U },
446 TensorShape{ 3U, 1U, 51U, 13U },
447 TensorShape{ 3U, 1U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100448 })
449 {
450 }
451};
452
453/** Data set containing large 1x3 tensor shapes. */
454class Large1x3Shapes final : public ShapeDataset
455{
456public:
457 Large1x3Shapes()
458 : ShapeDataset("Shape",
459 {
460 TensorShape{ 1U, 3U, 32U, 64U },
461 TensorShape{ 1U, 3U, 51U, 13U },
462 TensorShape{ 1U, 3U, 53U, 47U },
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100463 })
464 {
465 }
466};
467
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100468/** Data set containing small 5x5 tensor shapes. */
469class Small5x5Shapes final : public ShapeDataset
470{
471public:
472 Small5x5Shapes()
473 : ShapeDataset("Shape",
474 {
475 TensorShape{ 5U, 5U, 7U, 4U },
476 TensorShape{ 5U, 5U, 4U, 13U },
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100477 TensorShape{ 5U, 5U, 3U, 5U },
478 })
479 {
480 }
481};
482
483/** Data set containing large 5x5 tensor shapes. */
484class Large5x5Shapes final : public ShapeDataset
485{
486public:
487 Large5x5Shapes()
488 : ShapeDataset("Shape",
489 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000490 TensorShape{ 5U, 5U, 32U, 64U }
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100491 })
492 {
493 }
494};
495
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100496/** Data set containing small 5x1 tensor shapes. */
497class Small5x1Shapes final : public ShapeDataset
498{
499public:
500 Small5x1Shapes()
501 : ShapeDataset("Shape",
502 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000503 TensorShape{ 5U, 1U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100504 })
505 {
506 }
507};
508
509/** Data set containing large 5x1 tensor shapes. */
510class Large5x1Shapes final : public ShapeDataset
511{
512public:
513 Large5x1Shapes()
514 : ShapeDataset("Shape",
515 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000516 TensorShape{ 5U, 1U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100517 })
518 {
519 }
520};
521
522/** Data set containing small 1x5 tensor shapes. */
523class Small1x5Shapes final : public ShapeDataset
524{
525public:
526 Small1x5Shapes()
527 : ShapeDataset("Shape",
528 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000529 TensorShape{ 1U, 5U, 7U, 4U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100530 })
531 {
532 }
533};
534
535/** Data set containing large 1x5 tensor shapes. */
536class Large1x5Shapes final : public ShapeDataset
537{
538public:
539 Large1x5Shapes()
540 : ShapeDataset("Shape",
541 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000542 TensorShape{ 1U, 5U, 32U, 64U }
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100543 })
544 {
545 }
546};
547
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000548/** Data set containing small 1x7 tensor shapes. */
549class Small1x7Shapes final : public ShapeDataset
550{
551public:
552 Small1x7Shapes()
553 : ShapeDataset("Shape",
554 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000555 TensorShape{ 1U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000556 })
557 {
558 }
559};
560
561/** Data set containing large 1x7 tensor shapes. */
562class Large1x7Shapes final : public ShapeDataset
563{
564public:
565 Large1x7Shapes()
566 : ShapeDataset("Shape",
567 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000568 TensorShape{ 1U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000569 })
570 {
571 }
572};
573
574/** Data set containing small 7x7 tensor shapes. */
575class Small7x7Shapes final : public ShapeDataset
576{
577public:
578 Small7x7Shapes()
579 : ShapeDataset("Shape",
580 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000581 TensorShape{ 7U, 7U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000582 })
583 {
584 }
585};
586
587/** Data set containing large 7x7 tensor shapes. */
588class Large7x7Shapes final : public ShapeDataset
589{
590public:
591 Large7x7Shapes()
592 : ShapeDataset("Shape",
593 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000594 TensorShape{ 7U, 7U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000595 })
596 {
597 }
598};
599
600/** Data set containing small 7x1 tensor shapes. */
601class Small7x1Shapes final : public ShapeDataset
602{
603public:
604 Small7x1Shapes()
605 : ShapeDataset("Shape",
606 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000607 TensorShape{ 7U, 1U, 7U, 4U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000608 })
609 {
610 }
611};
612
613/** Data set containing large 7x1 tensor shapes. */
614class Large7x1Shapes final : public ShapeDataset
615{
616public:
617 Large7x1Shapes()
618 : ShapeDataset("Shape",
619 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000620 TensorShape{ 7U, 1U, 32U, 64U }
Michele Di Giorgio881c6842019-02-27 14:26:51 +0000621 })
622 {
623 }
624};
625
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100626/** Data set containing small tensor shapes for deconvolution. */
627class SmallDeconvolutionShapes final : public ShapeDataset
628{
629public:
630 SmallDeconvolutionShapes()
631 : ShapeDataset("InputShape",
632 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000633 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100634 TensorShape{ 5U, 5U, 3U },
635 TensorShape{ 11U, 13U, 4U, 3U }
636 })
637 {
638 }
639};
640
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000641/** Data set containing tiny tensor shapes for direct convolution. */
642class TinyDirectConvolutionShapes final : public ShapeDataset
643{
644public:
645 TinyDirectConvolutionShapes()
646 : ShapeDataset("InputShape",
647 {
648 // Batch size 1
649 TensorShape{ 11U, 13U, 3U },
650 TensorShape{ 7U, 27U, 3U }
651 })
652 {
653 }
654};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100655/** Data set containing small tensor shapes for direct convolution. */
656class SmallDirectConvolutionShapes final : public ShapeDataset
657{
658public:
659 SmallDirectConvolutionShapes()
660 : ShapeDataset("InputShape",
661 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100662 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100663 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100664 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100665 TensorShape{ 32U, 37U, 3U, 4U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100666 })
667 {
668 }
669};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100670
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800671/** Data set containing small tensor shapes for direct convolution. */
672class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
673{
674public:
675 SmallDirectConvolutionTensorShiftShapes()
676 : ShapeDataset("InputShape",
677 {
678 // Batch size 1
Sang-Hoon Parkcecb0a72019-09-17 08:59:09 +0100679 TensorShape{ 32U, 37U, 3U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800680 // Batch size 4
681 TensorShape{ 32U, 37U, 3U, 4U },
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800682 // Arbitrary batch size
683 TensorShape{ 32U, 37U, 3U, 8U }
684 })
685 {
686 }
687};
688
Giorgio Arena0f170392018-07-18 16:13:12 +0100689/** Data set containing small grouped im2col tensor shapes. */
690class GroupedIm2ColSmallShapes final : public ShapeDataset
691{
692public:
693 GroupedIm2ColSmallShapes()
694 : ShapeDataset("Shape",
695 {
696 TensorShape{ 11U, 11U, 48U },
697 TensorShape{ 27U, 13U, 24U },
698 TensorShape{ 128U, 64U, 12U, 3U },
699 TensorShape{ 11U, 11U, 48U, 4U },
700 TensorShape{ 27U, 13U, 24U, 4U },
701 TensorShape{ 11U, 11U, 48U, 5U }
702 })
703 {
704 }
705};
706
707/** Data set containing large grouped im2col tensor shapes. */
708class GroupedIm2ColLargeShapes final : public ShapeDataset
709{
710public:
711 GroupedIm2ColLargeShapes()
712 : ShapeDataset("Shape",
713 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100714 TensorShape{ 153U, 231U, 12U },
715 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100716 })
717 {
718 }
719};
720
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100721/** Data set containing small grouped weights tensor shapes. */
722class GroupedWeightsSmallShapes final : public ShapeDataset
723{
724public:
725 GroupedWeightsSmallShapes()
726 : ShapeDataset("Shape",
727 {
728 TensorShape{ 3U, 3U, 48U, 120U },
729 TensorShape{ 1U, 3U, 24U, 240U },
730 TensorShape{ 3U, 1U, 12U, 480U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000731 TensorShape{ 5U, 5U, 48U, 120U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100732 })
733 {
734 }
735};
736
737/** Data set containing large grouped weights tensor shapes. */
738class GroupedWeightsLargeShapes final : public ShapeDataset
739{
740public:
741 GroupedWeightsLargeShapes()
742 : ShapeDataset("Shape",
743 {
744 TensorShape{ 9U, 9U, 96U, 240U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000745 TensorShape{ 13U, 13U, 96U, 240U }
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100746 })
747 {
748 }
749};
750
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000751/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
752class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100753{
754public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000755 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100756 : ShapeDataset("Shape",
757 {
758 TensorShape{ 322U, 243U },
759 TensorShape{ 463U, 879U },
760 TensorShape{ 416U, 651U }
761 })
762 {
763 }
764};
765
Pablo Tello3dd5b682019-03-04 14:14:02 +0000766/** Data set containing tensor shapes for ConcatenateLayer. */
767class ConcatenateLayerShapes final : public ShapeDataset
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100768{
769public:
Pablo Tello3dd5b682019-03-04 14:14:02 +0000770 ConcatenateLayerShapes()
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100771 : ShapeDataset("Shape",
772 {
773 TensorShape{ 232U, 65U, 3U },
774 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100775 TensorShape{ 124U, 65U, 3U },
776 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100777 })
778 {
779 }
780};
781
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100782/** Data set containing global pooling tensor shapes. */
783class GlobalPoolingShapes final : public ShapeDataset
784{
785public:
786 GlobalPoolingShapes()
787 : ShapeDataset("Shape",
788 {
789 // Batch size 1
790 TensorShape{ 9U, 9U },
791 TensorShape{ 13U, 13U, 2U },
792 TensorShape{ 27U, 27U, 1U, 3U },
793 // Batch size 4
794 TensorShape{ 31U, 31U, 3U, 4U },
795 TensorShape{ 34U, 34U, 2U, 4U }
796 })
797 {
798 }
799};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000800/** Data set containing tiny softmax layer shapes. */
801class SoftmaxLayerTinyShapes final : public ShapeDataset
802{
803public:
804 SoftmaxLayerTinyShapes()
805 : ShapeDataset("Shape",
806 {
807 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100808 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000809 })
810 {
811 }
812};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100813
Chunosovd6afedc2017-11-06 22:09:45 +0700814/** Data set containing small softmax layer shapes. */
815class SoftmaxLayerSmallShapes final : public ShapeDataset
816{
817public:
818 SoftmaxLayerSmallShapes()
819 : ShapeDataset("Shape",
820 {
821 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100822 TensorShape{ 256U, 10U },
823 TensorShape{ 353U, 8U },
824 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700825 })
826 {
827 }
828};
829
830/** Data set containing large softmax layer shapes. */
831class SoftmaxLayerLargeShapes final : public ShapeDataset
832{
833public:
834 SoftmaxLayerLargeShapes()
835 : ShapeDataset("Shape",
836 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000837 TensorShape{ 1000U, 10U }
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100838
839 })
840 {
841 }
842};
843
844/** Data set containing large and small softmax layer 4D shapes. */
845class SoftmaxLayer4DShapes final : public ShapeDataset
846{
847public:
848 SoftmaxLayer4DShapes()
849 : ShapeDataset("Shape",
850 {
851 TensorShape{ 9U, 9U, 9U, 9U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000852 TensorShape{ 31U, 10U, 1U, 9U },
Chunosovd6afedc2017-11-06 22:09:45 +0700853 })
854 {
855 }
856};
857
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000858/** Data set containing 2D tensor shapes relative to an image size. */
859class SmallImageShapes final : public ShapeDataset
860{
861public:
862 SmallImageShapes()
863 : ShapeDataset("Shape",
864 {
865 TensorShape{ 640U, 480U },
866 TensorShape{ 800U, 600U },
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000867 })
868 {
869 }
870};
871
872/** Data set containing 2D tensor shapes relative to an image size. */
873class LargeImageShapes final : public ShapeDataset
874{
875public:
876 LargeImageShapes()
877 : ShapeDataset("Shape",
878 {
879 TensorShape{ 1920U, 1080U },
880 TensorShape{ 2560U, 1536U },
881 TensorShape{ 3584U, 2048U }
882 })
883 {
884 }
885};
Giorgio Arena73023022018-09-04 14:55:55 +0100886
887/** Data set containing small YOLO tensor shapes. */
888class SmallYOLOShapes final : public ShapeDataset
889{
890public:
891 SmallYOLOShapes()
892 : ShapeDataset("Shape",
893 {
894 // Batch size 1
895 TensorShape{ 11U, 11U, 270U },
896 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100897 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100898 })
899 {
900 }
901};
902
903/** Data set containing large YOLO tensor shapes. */
904class LargeYOLOShapes final : public ShapeDataset
905{
906public:
907 LargeYOLOShapes()
908 : ShapeDataset("Shape",
909 {
910 TensorShape{ 24U, 23U, 270U },
911 TensorShape{ 51U, 63U, 90U, 2U },
912 TensorShape{ 76U, 91U, 45U, 3U }
913 })
914 {
915 }
916};
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000917
918/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel */
919class SmallGEMMReshape2DShapes final : public ShapeDataset
920{
921public:
922 SmallGEMMReshape2DShapes()
923 : ShapeDataset("Shape",
924 {
925 TensorShape{ 63U, 72U },
926 })
927 {
928 }
929};
930
931/** Data set containing small tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
932class SmallGEMMReshape3DShapes final : public ShapeDataset
933{
934public:
935 SmallGEMMReshape3DShapes()
936 : ShapeDataset("Shape",
937 {
938 TensorShape{ 63U, 9U, 8U },
939 })
940 {
941 }
942};
943
944/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel */
945class LargeGEMMReshape2DShapes final : public ShapeDataset
946{
947public:
948 LargeGEMMReshape2DShapes()
949 : ShapeDataset("Shape",
950 {
951 TensorShape{ 16U, 27U },
Michalis Spyrou1d897772019-12-09 18:47:29 +0000952 TensorShape{ 345U, 171U }
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000953 })
954 {
955 }
956};
957
958/** Data set containing large tensor shapes to be used with the GEMM reshaping kernel when the input has to be reinterpreted as 3D */
959class LargeGEMMReshape3DShapes final : public ShapeDataset
960{
961public:
962 LargeGEMMReshape3DShapes()
963 : ShapeDataset("Shape",
964 {
965 TensorShape{ 16U, 3U, 9U },
Gian Marco Iodice5ba5e092018-12-06 17:13:09 +0000966 TensorShape{ 345U, 34U, 18U }
967 })
968 {
969 }
970};
Pablo Telloe96e4f02018-12-21 16:47:23 +0000971
972/** Data set containing small 2D tensor shapes. */
973class Small2DNonMaxSuppressionShapes final : public ShapeDataset
974{
975public:
976 Small2DNonMaxSuppressionShapes()
977 : ShapeDataset("Shape",
978 {
979 TensorShape{ 4U, 7U },
980 TensorShape{ 4U, 13U },
981 TensorShape{ 4U, 64U }
982 })
983 {
984 }
985};
986
987/** Data set containing large 2D tensor shapes. */
988class Large2DNonMaxSuppressionShapes final : public ShapeDataset
989{
990public:
991 Large2DNonMaxSuppressionShapes()
992 : ShapeDataset("Shape",
993 {
Michalis Spyrou1d897772019-12-09 18:47:29 +0000994 TensorShape{ 4U, 113U }
Pablo Telloe96e4f02018-12-21 16:47:23 +0000995 })
996 {
997 }
998};
999
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001000} // namespace datasets
1001} // namespace test
1002} // namespace arm_compute
Michalis Spyrouf4643372019-11-29 16:17:13 +00001003#endif /* ARM_COMPUTE_TEST_SHAPE_DATASETS_H */