blob: ffacf346209c983d3ba6e7b8c0bfe8a9ba0ba12f [file] [log] [blame]
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01001/*
Michalis Spyroud466c2d2018-01-30 10:54:39 +00002 * Copyright (c) 2017-2018 ARM Limited.
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__
25#define __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__
26
27#include "arm_compute/core/TensorShape.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010028#include "tests/framework/datasets/Datasets.h"
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010029
30#include <type_traits>
31
32namespace arm_compute
33{
34namespace test
35{
36namespace datasets
37{
Gian Marco5420b282017-11-29 10:41:38 +000038/** Parent type for all for shape datasets. */
39using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>;
40
41/** Data set containing small 1D tensor shapes. */
42class Small1DShapes final : public ShapeDataset
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010043{
44public:
Gian Marco5420b282017-11-29 10:41:38 +000045 Small1DShapes()
46 : ShapeDataset("Shape",
47 {
Giorgio Arenae3d24ce2018-08-24 14:44:08 +010048 TensorShape{ 128U },
49 TensorShape{ 256U },
50 TensorShape{ 512U },
51 TensorShape{ 1024U }
Gian Marco5420b282017-11-29 10:41:38 +000052 })
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010053 {
54 }
55};
56
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +000057/** Data set containing tiny 2D tensor shapes. */
58class Tiny2DShapes final : public ShapeDataset
59{
60public:
61 Tiny2DShapes()
62 : ShapeDataset("Shape",
63 {
64 TensorShape{ 7U, 7U },
65 TensorShape{ 11U, 13U },
66 })
67 {
68 }
69};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +010070/** Data set containing small 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010071class Small2DShapes final : public ShapeDataset
72{
73public:
74 Small2DShapes()
75 : ShapeDataset("Shape",
76 {
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +010077 TensorShape{ 7U, 7U },
78 TensorShape{ 27U, 13U },
79 TensorShape{ 128U, 64U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +010080 })
81 {
82 }
83};
84
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +000085/** Data set containing tiny 3D tensor shapes. */
86class Tiny3DShapes final : public ShapeDataset
87{
88public:
89 Tiny3DShapes()
90 : ShapeDataset("Shape",
91 {
92 TensorShape{ 7U, 7U, 5U },
93 TensorShape{ 23U, 13U, 9U },
94 })
95 {
96 }
97};
98
Gian Marco Iodice06b184a2017-08-29 16:05:25 +010099/** Data set containing small 3D tensor shapes. */
100class Small3DShapes final : public ShapeDataset
101{
102public:
103 Small3DShapes()
104 : ShapeDataset("Shape",
105 {
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000106 TensorShape{ 1U, 7U, 7U },
107 TensorShape{ 7U, 7U, 5U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100108 TensorShape{ 27U, 13U, 37U },
109 TensorShape{ 128U, 64U, 21U }
110 })
111 {
112 }
113};
114
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000115/** Data set containing tiny 4D tensor shapes. */
116class Tiny4DShapes final : public ShapeDataset
117{
118public:
119 Tiny4DShapes()
120 : ShapeDataset("Shape",
121 {
122 TensorShape{ 7U, 7U, 5U, 3U },
123 TensorShape{ 17U, 13U, 7U, 2U },
124 })
125 {
126 }
127};
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100128/** Data set containing small 4D tensor shapes. */
129class Small4DShapes final : public ShapeDataset
130{
131public:
132 Small4DShapes()
133 : ShapeDataset("Shape",
134 {
Georgios Pinitas02ee4292018-02-15 17:22:36 +0000135 TensorShape{ 1U, 7U, 1U, 3U },
136 TensorShape{ 7U, 7U, 5U, 3U },
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100137 TensorShape{ 27U, 13U, 37U, 2U },
138 TensorShape{ 128U, 64U, 21U, 3U }
139 })
140 {
141 }
142};
143
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100144/** Data set containing small tensor shapes. */
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000145class TinyShapes final : public ShapeDataset
146{
147public:
148 TinyShapes()
149 : ShapeDataset("Shape",
150 {
151 // Batch size 1
152 TensorShape{ 9U, 9U },
153 TensorShape{ 27U, 13U, 2U },
154 })
155 {
156 }
157};
158/** Data set containing small tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100159class SmallShapes final : public ShapeDataset
160{
161public:
162 SmallShapes()
163 : ShapeDataset("Shape",
164 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100165 // Batch size 1
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100166 TensorShape{ 11U, 11U },
Georgios Pinitas64f1a902018-09-18 13:42:51 +0100167 TensorShape{ 27U, 13U, 7U },
168 TensorShape{ 31U, 27U, 17U, 2U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100169 // Batch size 4
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100170 TensorShape{ 11U, 11U, 3U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100171 TensorShape{ 27U, 13U, 2U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100172 // Arbitrary batch size
Gian Marco Iodice215b4ea2018-06-28 16:29:29 +0100173 TensorShape{ 11U, 11U, 3U, 5U }
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100174 })
175 {
176 }
177};
178
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000179/** Data set containing pairs of small tensor shapes that are broadcast compatible. */
180class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
181{
182public:
183 SmallShapesBroadcast()
184 : ZipDataset<ShapeDataset, ShapeDataset>(
185 ShapeDataset("Shape0",
186 {
187 TensorShape{ 9U, 9U },
188 TensorShape{ 27U, 13U, 2U },
189 TensorShape{ 128U, 1U, 5U, 3U },
190 TensorShape{ 9U, 9U, 3U, 4U },
191 TensorShape{ 27U, 13U, 2U, 4U },
192 TensorShape{ 1U, 1U, 1U, 5U }
193 }),
194 ShapeDataset("Shape1",
195 {
196 TensorShape{ 9U, 1U, 2U },
197 TensorShape{ 1U, 13U, 2U },
198 TensorShape{ 128U, 64U, 1U, 3U },
199 TensorShape{ 9U, 1U, 3U },
200 TensorShape{ 1U },
201 TensorShape{ 9U, 9U, 3U, 5U }
202 }))
203 {
204 }
205};
206
steniu01f81652d2017-09-11 15:29:12 +0100207/** Data set containing medium tensor shapes. */
208class MediumShapes final : public ShapeDataset
209{
210public:
211 MediumShapes()
212 : ShapeDataset("Shape",
213 {
214 // Batch size 1
215 TensorShape{ 37U, 37U },
216 TensorShape{ 27U, 33U, 2U },
217 TensorShape{ 128U, 64U, 1U, 3U },
218 // Batch size 4
219 TensorShape{ 37U, 37U, 3U, 4U },
220 TensorShape{ 27U, 33U, 2U, 4U },
221 // Arbitrary batch size
222 TensorShape{ 37U, 37U, 3U, 5U }
223 })
224 {
225 }
226};
227
Gian Marco37908d92017-11-07 14:38:22 +0000228/** Data set containing medium 2D tensor shapes. */
229class Medium2DShapes final : public ShapeDataset
230{
231public:
232 Medium2DShapes()
233 : ShapeDataset("Shape",
234 {
235 TensorShape{ 42U, 37U },
236 TensorShape{ 57U, 60U },
237 TensorShape{ 128U, 64U },
Gian Marco Iodice2abb2162018-04-11 10:49:04 +0100238 TensorShape{ 83U, 72U },
239 TensorShape{ 40U, 40U }
Gian Marco37908d92017-11-07 14:38:22 +0000240 })
241 {
242 }
243};
244
Gian Marco Iodice7e4b2392018-02-22 16:17:20 +0000245/** Data set containing medium 3D tensor shapes. */
246class Medium3DShapes final : public ShapeDataset
247{
248public:
249 Medium3DShapes()
250 : ShapeDataset("Shape",
251 {
252 TensorShape{ 42U, 37U, 8U },
253 TensorShape{ 57U, 60U, 13U },
254 TensorShape{ 128U, 64U, 21U },
255 TensorShape{ 83U, 72U, 14U }
256 })
257 {
258 }
259};
260
261/** Data set containing medium 4D tensor shapes. */
262class Medium4DShapes final : public ShapeDataset
263{
264public:
265 Medium4DShapes()
266 : ShapeDataset("Shape",
267 {
268 TensorShape{ 42U, 37U, 8U, 15U },
269 TensorShape{ 57U, 60U, 13U, 8U },
270 TensorShape{ 128U, 64U, 21U, 13U },
271 TensorShape{ 83U, 72U, 14U, 5U }
272 })
273 {
274 }
275};
276
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100277/** Data set containing large tensor shapes. */
278class LargeShapes final : public ShapeDataset
279{
280public:
281 LargeShapes()
282 : ShapeDataset("Shape",
283 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100284 // Batch size 1
Gian Marco7f0f7902017-12-07 09:26:56 +0000285 TensorShape{ 1921U, 1083U },
286 TensorShape{ 641U, 485U, 2U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100287 // Batch size 4
Gian Marco7f0f7902017-12-07 09:26:56 +0000288 TensorShape{ 799U, 595U, 1U, 4U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100289 })
290 {
291 }
292};
293
Diego Lopez Recas0021d752017-12-18 14:42:56 +0000294/** Data set containing pairs of large tensor shapes that are broadcast compatible. */
295class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset>
296{
297public:
298 LargeShapesBroadcast()
299 : ZipDataset<ShapeDataset, ShapeDataset>(
300 ShapeDataset("Shape0",
301 {
302 TensorShape{ 1921U, 541U },
303 TensorShape{ 1U, 485U, 2U, 3U },
304 TensorShape{ 4159U, 1U },
305 TensorShape{ 799U }
306 }),
307 ShapeDataset("Shape1",
308 {
309 TensorShape{ 1921U, 1U, 2U },
310 TensorShape{ 641U, 1U, 2U, 3U },
311 TensorShape{ 1U, 127U, 25U },
312 TensorShape{ 799U, 595U, 1U, 4U }
313 }))
314 {
315 }
316};
317
Gian Marco5420b282017-11-29 10:41:38 +0000318/** Data set containing large 1D tensor shapes. */
319class Large1DShapes final : public ShapeDataset
320{
321public:
322 Large1DShapes()
323 : ShapeDataset("Shape",
324 {
325 TensorShape{ 1921U },
326 TensorShape{ 1245U },
327 TensorShape{ 4160U }
328 })
329 {
330 }
331};
332
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100333/** Data set containing large 2D tensor shapes. */
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100334class Large2DShapes final : public ShapeDataset
335{
336public:
337 Large2DShapes()
338 : ShapeDataset("Shape",
339 {
340 TensorShape{ 1920U, 1080U },
Moritz Pflanzer3ce3ff42017-07-21 17:41:02 +0100341 TensorShape{ 1245U, 652U },
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100342 TensorShape{ 4160U, 3120U }
343 })
344 {
345 }
346};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100347
Gian Marco Iodice06b184a2017-08-29 16:05:25 +0100348/** Data set containing large 3D tensor shapes. */
349class Large3DShapes final : public ShapeDataset
350{
351public:
352 Large3DShapes()
353 : ShapeDataset("Shape",
354 {
355 TensorShape{ 320U, 240U, 3U },
356 TensorShape{ 383U, 653U, 2U },
357 TensorShape{ 721U, 123U, 13U }
358 })
359 {
360 }
361};
362
363/** Data set containing large 4D tensor shapes. */
364class Large4DShapes final : public ShapeDataset
365{
366public:
367 Large4DShapes()
368 : ShapeDataset("Shape",
369 {
370 TensorShape{ 320U, 123U, 3U, 3U },
371 TensorShape{ 383U, 413U, 2U, 3U },
372 TensorShape{ 517U, 123U, 13U, 2U }
373 })
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 },
387 TensorShape{ 3U, 3U, 9U, 2U },
388 TensorShape{ 3U, 3U, 3U, 5U },
389 })
390 {
391 }
392};
393
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100394/** Data set containing small 3x1 tensor shapes. */
395class Small3x1Shapes final : public ShapeDataset
396{
397public:
398 Small3x1Shapes()
399 : ShapeDataset("Shape",
400 {
401 TensorShape{ 3U, 1U, 7U, 4U },
402 TensorShape{ 3U, 1U, 4U, 13U },
403 TensorShape{ 3U, 1U, 9U, 2U },
404 TensorShape{ 3U, 1U, 3U, 5U },
405 })
406 {
407 }
408};
409
410/** Data set containing small 1x3 tensor shapes. */
411class Small1x3Shapes final : public ShapeDataset
412{
413public:
414 Small1x3Shapes()
415 : ShapeDataset("Shape",
416 {
417 TensorShape{ 1U, 3U, 7U, 4U },
418 TensorShape{ 1U, 3U, 4U, 13U },
419 TensorShape{ 1U, 3U, 9U, 2U },
420 TensorShape{ 1U, 3U, 3U, 5U },
421 })
422 {
423 }
424};
425
Gian Marco Iodice247f52c2018-03-22 11:24:56 +0000426/** Data set containing large 3x3 tensor shapes. */
427class Large3x3Shapes final : public ShapeDataset
428{
429public:
430 Large3x3Shapes()
431 : ShapeDataset("Shape",
432 {
433 TensorShape{ 3U, 3U, 32U, 64U },
434 TensorShape{ 3U, 3U, 51U, 13U },
435 TensorShape{ 3U, 3U, 53U, 47U },
436 TensorShape{ 3U, 3U, 128U, 384U },
437 })
438 {
439 }
440};
441
Gian Marco Iodicef1c2bf02018-06-13 14:05:54 +0100442/** Data set containing large 3x1 tensor shapes. */
443class Large3x1Shapes final : public ShapeDataset
444{
445public:
446 Large3x1Shapes()
447 : ShapeDataset("Shape",
448 {
449 TensorShape{ 3U, 1U, 32U, 64U },
450 TensorShape{ 3U, 1U, 51U, 13U },
451 TensorShape{ 3U, 1U, 53U, 47U },
452 TensorShape{ 3U, 1U, 128U, 384U },
453 })
454 {
455 }
456};
457
458/** Data set containing large 1x3 tensor shapes. */
459class Large1x3Shapes final : public ShapeDataset
460{
461public:
462 Large1x3Shapes()
463 : ShapeDataset("Shape",
464 {
465 TensorShape{ 1U, 3U, 32U, 64U },
466 TensorShape{ 1U, 3U, 51U, 13U },
467 TensorShape{ 1U, 3U, 53U, 47U },
468 TensorShape{ 1U, 3U, 128U, 384U },
469 })
470 {
471 }
472};
473
Giorgio Arena9373c8b2018-04-11 19:07:17 +0100474/** Data set containing small 5x5 tensor shapes. */
475class Small5x5Shapes final : public ShapeDataset
476{
477public:
478 Small5x5Shapes()
479 : ShapeDataset("Shape",
480 {
481 TensorShape{ 5U, 5U, 7U, 4U },
482 TensorShape{ 5U, 5U, 4U, 13U },
483 TensorShape{ 5U, 5U, 9U, 2U },
484 TensorShape{ 5U, 5U, 3U, 5U },
485 })
486 {
487 }
488};
489
490/** Data set containing large 5x5 tensor shapes. */
491class Large5x5Shapes final : public ShapeDataset
492{
493public:
494 Large5x5Shapes()
495 : ShapeDataset("Shape",
496 {
497 TensorShape{ 5U, 5U, 32U, 64U },
498 TensorShape{ 5U, 5U, 51U, 13U },
499 TensorShape{ 5U, 5U, 53U, 47U },
500 TensorShape{ 5U, 5U, 128U, 384U },
501 })
502 {
503 }
504};
505
Gian Marco Iodice876be2a2018-07-03 12:22:09 +0100506/** Data set containing small 5x1 tensor shapes. */
507class Small5x1Shapes final : public ShapeDataset
508{
509public:
510 Small5x1Shapes()
511 : ShapeDataset("Shape",
512 {
513 TensorShape{ 5U, 1U, 7U, 4U },
514 TensorShape{ 5U, 1U, 4U, 13U },
515 TensorShape{ 5U, 1U, 9U, 2U },
516 TensorShape{ 5U, 1U, 3U, 5U },
517 })
518 {
519 }
520};
521
522/** Data set containing large 5x1 tensor shapes. */
523class Large5x1Shapes final : public ShapeDataset
524{
525public:
526 Large5x1Shapes()
527 : ShapeDataset("Shape",
528 {
529 TensorShape{ 5U, 1U, 32U, 64U },
530 TensorShape{ 5U, 1U, 51U, 13U },
531 TensorShape{ 5U, 1U, 53U, 47U },
532 TensorShape{ 5U, 1U, 128U, 384U },
533 })
534 {
535 }
536};
537
538/** Data set containing small 1x5 tensor shapes. */
539class Small1x5Shapes final : public ShapeDataset
540{
541public:
542 Small1x5Shapes()
543 : ShapeDataset("Shape",
544 {
545 TensorShape{ 1U, 5U, 7U, 4U },
546 TensorShape{ 1U, 5U, 4U, 13U },
547 TensorShape{ 1U, 5U, 9U, 2U },
548 TensorShape{ 1U, 5U, 3U, 5U },
549 })
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 {
561 TensorShape{ 1U, 5U, 32U, 64U },
562 TensorShape{ 1U, 5U, 51U, 13U },
563 TensorShape{ 1U, 5U, 53U, 47U },
564 TensorShape{ 1U, 5U, 128U, 384U },
565 })
566 {
567 }
568};
569
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100570/** Data set containing small tensor shapes for deconvolution. */
571class SmallDeconvolutionShapes final : public ShapeDataset
572{
573public:
574 SmallDeconvolutionShapes()
575 : ShapeDataset("InputShape",
576 {
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000577 TensorShape{ 5U, 4U, 3U, 2U },
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100578 TensorShape{ 5U, 5U, 3U },
579 TensorShape{ 11U, 13U, 4U, 3U }
580 })
581 {
582 }
583};
584
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000585/** Data set containing tiny tensor shapes for direct convolution. */
586class TinyDirectConvolutionShapes final : public ShapeDataset
587{
588public:
589 TinyDirectConvolutionShapes()
590 : ShapeDataset("InputShape",
591 {
592 // Batch size 1
593 TensorShape{ 11U, 13U, 3U },
594 TensorShape{ 7U, 27U, 3U }
595 })
596 {
597 }
598};
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100599/** Data set containing small tensor shapes for direct convolution. */
600class SmallDirectConvolutionShapes final : public ShapeDataset
601{
602public:
603 SmallDirectConvolutionShapes()
604 : ShapeDataset("InputShape",
605 {
SiCong Licaf8c5e2017-08-21 13:12:52 +0100606 // Batch size 1
steniu01f81652d2017-09-11 15:29:12 +0100607 TensorShape{ 35U, 35U, 3U },
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100608 TensorShape{ 32U, 37U, 3U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100609 // Batch size 4
SiCong Licaf8c5e2017-08-21 13:12:52 +0100610 TensorShape{ 32U, 37U, 3U, 4U },
SiCong Licaf8c5e2017-08-21 13:12:52 +0100611 // Batch size 8
SiCong Licaf8c5e2017-08-21 13:12:52 +0100612 TensorShape{ 32U, 37U, 3U, 8U },
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000613 TensorShape{ 33U, 35U, 8U, 8U }
Moritz Pflanzerb3d25792017-07-26 11:49:37 +0100614 })
615 {
616 }
617};
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100618
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800619/** Data set containing small tensor shapes for direct convolution. */
620class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset
621{
622public:
623 SmallDirectConvolutionTensorShiftShapes()
624 : ShapeDataset("InputShape",
625 {
626 // Batch size 1
627 TensorShape{ 35U, 35U, 3U },
628 TensorShape{ 32U, 37U, 3U },
629 // Batch size 4
630 TensorShape{ 32U, 37U, 3U, 4U },
631 // Batch size 8
632 TensorShape{ 32U, 37U, 3U, 8U },
633 TensorShape{ 33U, 35U, 3U, 8U },
634 // Arbitrary batch size
635 TensorShape{ 32U, 37U, 3U, 8U }
636 })
637 {
638 }
639};
640
Giorgio Arena0f170392018-07-18 16:13:12 +0100641/** Data set containing small grouped im2col tensor shapes. */
642class GroupedIm2ColSmallShapes final : public ShapeDataset
643{
644public:
645 GroupedIm2ColSmallShapes()
646 : ShapeDataset("Shape",
647 {
648 TensorShape{ 11U, 11U, 48U },
649 TensorShape{ 27U, 13U, 24U },
650 TensorShape{ 128U, 64U, 12U, 3U },
651 TensorShape{ 11U, 11U, 48U, 4U },
652 TensorShape{ 27U, 13U, 24U, 4U },
653 TensorShape{ 11U, 11U, 48U, 5U }
654 })
655 {
656 }
657};
658
659/** Data set containing large grouped im2col tensor shapes. */
660class GroupedIm2ColLargeShapes final : public ShapeDataset
661{
662public:
663 GroupedIm2ColLargeShapes()
664 : ShapeDataset("Shape",
665 {
Georgios Pinitas2a518182018-08-13 15:53:31 +0100666 TensorShape{ 153U, 231U, 12U },
667 TensorShape{ 123U, 191U, 12U, 2U },
Giorgio Arena0f170392018-07-18 16:13:12 +0100668 })
669 {
670 }
671};
672
Giorgio Arenac6aa49b2018-08-07 11:53:30 +0100673/** Data set containing small grouped weights tensor shapes. */
674class GroupedWeightsSmallShapes final : public ShapeDataset
675{
676public:
677 GroupedWeightsSmallShapes()
678 : ShapeDataset("Shape",
679 {
680 TensorShape{ 3U, 3U, 48U, 120U },
681 TensorShape{ 1U, 3U, 24U, 240U },
682 TensorShape{ 3U, 1U, 12U, 480U },
683 TensorShape{ 5U, 5U, 48U, 120U },
684 TensorShape{ 1U, 5U, 24U, 240U },
685 TensorShape{ 5U, 1U, 48U, 480U }
686 })
687 {
688 }
689};
690
691/** Data set containing large grouped weights tensor shapes. */
692class GroupedWeightsLargeShapes final : public ShapeDataset
693{
694public:
695 GroupedWeightsLargeShapes()
696 : ShapeDataset("Shape",
697 {
698 TensorShape{ 9U, 9U, 96U, 240U },
699 TensorShape{ 7U, 9U, 48U, 480U },
700 TensorShape{ 9U, 7U, 24U, 960U },
701 TensorShape{ 13U, 13U, 96U, 240U },
702 TensorShape{ 11U, 13U, 48U, 480U },
703 TensorShape{ 13U, 11U, 24U, 960U }
704 })
705 {
706 }
707};
708
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000709/** Data set containing 2D tensor shapes for DepthConcatenateLayer. */
710class DepthConcatenateLayerShapes final : public ShapeDataset
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100711{
712public:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000713 DepthConcatenateLayerShapes()
Gian Marco Iodiceb2833b82017-09-13 16:23:18 +0100714 : ShapeDataset("Shape",
715 {
716 TensorShape{ 322U, 243U },
717 TensorShape{ 463U, 879U },
718 TensorShape{ 416U, 651U }
719 })
720 {
721 }
722};
723
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100724/** Data set containing tensor shapes for WidthConcatenateLayer. */
725class WidthConcatenateLayerShapes final : public ShapeDataset
726{
727public:
728 WidthConcatenateLayerShapes()
729 : ShapeDataset("Shape",
730 {
731 TensorShape{ 232U, 65U, 3U },
732 TensorShape{ 432U, 65U, 3U },
Michele Di Giorgioe6dbde02018-10-19 15:46:19 +0100733 TensorShape{ 124U, 65U, 3U },
734 TensorShape{ 124U, 65U, 3U, 4U }
Michalis Spyrou55b3d122018-05-09 09:59:23 +0100735 })
736 {
737 }
738};
739
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100740/** Data set containing global pooling tensor shapes. */
741class GlobalPoolingShapes final : public ShapeDataset
742{
743public:
744 GlobalPoolingShapes()
745 : ShapeDataset("Shape",
746 {
747 // Batch size 1
748 TensorShape{ 9U, 9U },
749 TensorShape{ 13U, 13U, 2U },
750 TensorShape{ 27U, 27U, 1U, 3U },
751 // Batch size 4
752 TensorShape{ 31U, 31U, 3U, 4U },
753 TensorShape{ 34U, 34U, 2U, 4U }
754 })
755 {
756 }
757};
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000758/** Data set containing tiny softmax layer shapes. */
759class SoftmaxLayerTinyShapes final : public ShapeDataset
760{
761public:
762 SoftmaxLayerTinyShapes()
763 : ShapeDataset("Shape",
764 {
765 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100766 TensorShape{ 128U, 10U },
Anthony Barbier1c0d0ff2018-01-31 13:05:09 +0000767 })
768 {
769 }
770};
Gian Marco Iodicebf179552017-09-05 13:51:21 +0100771
Chunosovd6afedc2017-11-06 22:09:45 +0700772/** Data set containing small softmax layer shapes. */
773class SoftmaxLayerSmallShapes final : public ShapeDataset
774{
775public:
776 SoftmaxLayerSmallShapes()
777 : ShapeDataset("Shape",
778 {
779 TensorShape{ 9U, 9U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100780 TensorShape{ 256U, 10U },
781 TensorShape{ 353U, 8U },
782 TensorShape{ 781U, 5U },
Chunosovd6afedc2017-11-06 22:09:45 +0700783 })
784 {
785 }
786};
787
788/** Data set containing large softmax layer shapes. */
789class SoftmaxLayerLargeShapes final : public ShapeDataset
790{
791public:
792 SoftmaxLayerLargeShapes()
793 : ShapeDataset("Shape",
794 {
795 TensorShape{ 1000U, 10U },
Georgios Pinitas17d6d3c2018-07-02 17:52:40 +0100796 TensorShape{ 3989U, 10U },
Chunosovd6afedc2017-11-06 22:09:45 +0700797 TensorShape{ 7339U, 11U },
Giuseppe Rossini87e896a2018-08-24 10:24:12 +0100798
799 })
800 {
801 }
802};
803
804/** Data set containing large and small softmax layer 4D shapes. */
805class SoftmaxLayer4DShapes final : public ShapeDataset
806{
807public:
808 SoftmaxLayer4DShapes()
809 : ShapeDataset("Shape",
810 {
811 TensorShape{ 9U, 9U, 9U, 9U },
812 TensorShape{ 256U, 10U, 1U, 9U },
813 TensorShape{ 353U, 8U, 2U },
814 TensorShape{ 781U, 5U, 2U, 2U },
815 TensorShape{ 781U, 11U, 1U, 2U },
Chunosovd6afedc2017-11-06 22:09:45 +0700816 })
817 {
818 }
819};
820
Ioan-Cristian Szabo2c350182017-12-20 16:27:37 +0000821/** Data set containing 2D tensor shapes relative to an image size. */
822class SmallImageShapes final : public ShapeDataset
823{
824public:
825 SmallImageShapes()
826 : ShapeDataset("Shape",
827 {
828 TensorShape{ 640U, 480U },
829 TensorShape{ 800U, 600U },
830 TensorShape{ 1200U, 800U }
831 })
832 {
833 }
834};
835
836/** Data set containing 2D tensor shapes relative to an image size. */
837class LargeImageShapes final : public ShapeDataset
838{
839public:
840 LargeImageShapes()
841 : ShapeDataset("Shape",
842 {
843 TensorShape{ 1920U, 1080U },
844 TensorShape{ 2560U, 1536U },
845 TensorShape{ 3584U, 2048U }
846 })
847 {
848 }
849};
Giorgio Arena73023022018-09-04 14:55:55 +0100850
851/** Data set containing small YOLO tensor shapes. */
852class SmallYOLOShapes final : public ShapeDataset
853{
854public:
855 SmallYOLOShapes()
856 : ShapeDataset("Shape",
857 {
858 // Batch size 1
859 TensorShape{ 11U, 11U, 270U },
860 TensorShape{ 27U, 13U, 90U },
Gian Marco Iodice8e1f3c02018-09-13 15:56:47 +0100861 TensorShape{ 13U, 12U, 45U, 2U },
Giorgio Arena73023022018-09-04 14:55:55 +0100862 })
863 {
864 }
865};
866
867/** Data set containing large YOLO tensor shapes. */
868class LargeYOLOShapes final : public ShapeDataset
869{
870public:
871 LargeYOLOShapes()
872 : ShapeDataset("Shape",
873 {
874 TensorShape{ 24U, 23U, 270U },
875 TensorShape{ 51U, 63U, 90U, 2U },
876 TensorShape{ 76U, 91U, 45U, 3U }
877 })
878 {
879 }
880};
Moritz Pflanzerf6ad98a2017-07-21 17:19:58 +0100881} // namespace datasets
882} // namespace test
883} // namespace arm_compute
884#endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */