Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 ARM Limited. |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 3 | * |
| 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 Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 28 | #include "tests/framework/datasets/Datasets.h" |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 29 | |
| 30 | #include <type_traits> |
| 31 | |
| 32 | namespace arm_compute |
| 33 | { |
| 34 | namespace test |
| 35 | { |
| 36 | namespace datasets |
| 37 | { |
Gian Marco | 5420b28 | 2017-11-29 10:41:38 +0000 | [diff] [blame] | 38 | /** Parent type for all for shape datasets. */ |
| 39 | using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>; |
| 40 | |
| 41 | /** Data set containing small 1D tensor shapes. */ |
| 42 | class Small1DShapes final : public ShapeDataset |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 43 | { |
| 44 | public: |
Gian Marco | 5420b28 | 2017-11-29 10:41:38 +0000 | [diff] [blame] | 45 | Small1DShapes() |
| 46 | : ShapeDataset("Shape", |
| 47 | { |
| 48 | TensorShape{ 256U } |
| 49 | }) |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 50 | { |
| 51 | } |
| 52 | }; |
| 53 | |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 54 | /** Data set containing tiny 2D tensor shapes. */ |
| 55 | class Tiny2DShapes final : public ShapeDataset |
| 56 | { |
| 57 | public: |
| 58 | Tiny2DShapes() |
| 59 | : ShapeDataset("Shape", |
| 60 | { |
| 61 | TensorShape{ 7U, 7U }, |
| 62 | TensorShape{ 11U, 13U }, |
| 63 | }) |
| 64 | { |
| 65 | } |
| 66 | }; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 67 | /** Data set containing small 2D tensor shapes. */ |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 68 | class Small2DShapes final : public ShapeDataset |
| 69 | { |
| 70 | public: |
| 71 | Small2DShapes() |
| 72 | : ShapeDataset("Shape", |
| 73 | { |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 74 | TensorShape{ 7U, 7U }, |
| 75 | TensorShape{ 27U, 13U }, |
| 76 | TensorShape{ 128U, 64U } |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 77 | }) |
| 78 | { |
| 79 | } |
| 80 | }; |
| 81 | |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 82 | /** Data set containing tiny 3D tensor shapes. */ |
| 83 | class Tiny3DShapes final : public ShapeDataset |
| 84 | { |
| 85 | public: |
| 86 | Tiny3DShapes() |
| 87 | : ShapeDataset("Shape", |
| 88 | { |
| 89 | TensorShape{ 7U, 7U, 5U }, |
| 90 | TensorShape{ 23U, 13U, 9U }, |
| 91 | }) |
| 92 | { |
| 93 | } |
| 94 | }; |
| 95 | |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 96 | /** Data set containing small 3D tensor shapes. */ |
| 97 | class Small3DShapes final : public ShapeDataset |
| 98 | { |
| 99 | public: |
| 100 | Small3DShapes() |
| 101 | : ShapeDataset("Shape", |
| 102 | { |
Georgios Pinitas | 02ee429 | 2018-02-15 17:22:36 +0000 | [diff] [blame] | 103 | TensorShape{ 1U, 7U, 7U }, |
| 104 | TensorShape{ 7U, 7U, 5U }, |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 105 | TensorShape{ 27U, 13U, 37U }, |
| 106 | TensorShape{ 128U, 64U, 21U } |
| 107 | }) |
| 108 | { |
| 109 | } |
| 110 | }; |
| 111 | |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 112 | /** Data set containing tiny 4D tensor shapes. */ |
| 113 | class Tiny4DShapes final : public ShapeDataset |
| 114 | { |
| 115 | public: |
| 116 | Tiny4DShapes() |
| 117 | : ShapeDataset("Shape", |
| 118 | { |
| 119 | TensorShape{ 7U, 7U, 5U, 3U }, |
| 120 | TensorShape{ 17U, 13U, 7U, 2U }, |
| 121 | }) |
| 122 | { |
| 123 | } |
| 124 | }; |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 125 | /** Data set containing small 4D tensor shapes. */ |
| 126 | class Small4DShapes final : public ShapeDataset |
| 127 | { |
| 128 | public: |
| 129 | Small4DShapes() |
| 130 | : ShapeDataset("Shape", |
| 131 | { |
Georgios Pinitas | 02ee429 | 2018-02-15 17:22:36 +0000 | [diff] [blame] | 132 | TensorShape{ 1U, 7U, 1U, 3U }, |
| 133 | TensorShape{ 7U, 7U, 5U, 3U }, |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 134 | TensorShape{ 27U, 13U, 37U, 2U }, |
| 135 | TensorShape{ 128U, 64U, 21U, 3U } |
| 136 | }) |
| 137 | { |
| 138 | } |
| 139 | }; |
| 140 | |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 141 | /** Data set containing small tensor shapes. */ |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 142 | class TinyShapes final : public ShapeDataset |
| 143 | { |
| 144 | public: |
| 145 | TinyShapes() |
| 146 | : ShapeDataset("Shape", |
| 147 | { |
| 148 | // Batch size 1 |
| 149 | TensorShape{ 9U, 9U }, |
| 150 | TensorShape{ 27U, 13U, 2U }, |
| 151 | }) |
| 152 | { |
| 153 | } |
| 154 | }; |
| 155 | /** Data set containing small tensor shapes. */ |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 156 | class SmallShapes final : public ShapeDataset |
| 157 | { |
| 158 | public: |
| 159 | SmallShapes() |
| 160 | : ShapeDataset("Shape", |
| 161 | { |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 162 | // Batch size 1 |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 163 | TensorShape{ 11U, 11U }, |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 164 | TensorShape{ 27U, 13U, 2U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 165 | TensorShape{ 128U, 64U, 1U, 3U }, |
| 166 | // Batch size 4 |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 167 | TensorShape{ 11U, 11U, 3U, 4U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 168 | TensorShape{ 27U, 13U, 2U, 4U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 169 | // Arbitrary batch size |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 170 | TensorShape{ 11U, 11U, 3U, 5U } |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 171 | }) |
| 172 | { |
| 173 | } |
| 174 | }; |
| 175 | |
Diego Lopez Recas | 0021d75 | 2017-12-18 14:42:56 +0000 | [diff] [blame] | 176 | /** Data set containing pairs of small tensor shapes that are broadcast compatible. */ |
| 177 | class SmallShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset> |
| 178 | { |
| 179 | public: |
| 180 | SmallShapesBroadcast() |
| 181 | : ZipDataset<ShapeDataset, ShapeDataset>( |
| 182 | ShapeDataset("Shape0", |
| 183 | { |
| 184 | TensorShape{ 9U, 9U }, |
| 185 | TensorShape{ 27U, 13U, 2U }, |
| 186 | TensorShape{ 128U, 1U, 5U, 3U }, |
| 187 | TensorShape{ 9U, 9U, 3U, 4U }, |
| 188 | TensorShape{ 27U, 13U, 2U, 4U }, |
| 189 | TensorShape{ 1U, 1U, 1U, 5U } |
| 190 | }), |
| 191 | ShapeDataset("Shape1", |
| 192 | { |
| 193 | TensorShape{ 9U, 1U, 2U }, |
| 194 | TensorShape{ 1U, 13U, 2U }, |
| 195 | TensorShape{ 128U, 64U, 1U, 3U }, |
| 196 | TensorShape{ 9U, 1U, 3U }, |
| 197 | TensorShape{ 1U }, |
| 198 | TensorShape{ 9U, 9U, 3U, 5U } |
| 199 | })) |
| 200 | { |
| 201 | } |
| 202 | }; |
| 203 | |
steniu01 | f81652d | 2017-09-11 15:29:12 +0100 | [diff] [blame] | 204 | /** Data set containing medium tensor shapes. */ |
| 205 | class MediumShapes final : public ShapeDataset |
| 206 | { |
| 207 | public: |
| 208 | MediumShapes() |
| 209 | : ShapeDataset("Shape", |
| 210 | { |
| 211 | // Batch size 1 |
| 212 | TensorShape{ 37U, 37U }, |
| 213 | TensorShape{ 27U, 33U, 2U }, |
| 214 | TensorShape{ 128U, 64U, 1U, 3U }, |
| 215 | // Batch size 4 |
| 216 | TensorShape{ 37U, 37U, 3U, 4U }, |
| 217 | TensorShape{ 27U, 33U, 2U, 4U }, |
| 218 | // Arbitrary batch size |
| 219 | TensorShape{ 37U, 37U, 3U, 5U } |
| 220 | }) |
| 221 | { |
| 222 | } |
| 223 | }; |
| 224 | |
Gian Marco | 37908d9 | 2017-11-07 14:38:22 +0000 | [diff] [blame] | 225 | /** Data set containing medium 2D tensor shapes. */ |
| 226 | class Medium2DShapes final : public ShapeDataset |
| 227 | { |
| 228 | public: |
| 229 | Medium2DShapes() |
| 230 | : ShapeDataset("Shape", |
| 231 | { |
| 232 | TensorShape{ 42U, 37U }, |
| 233 | TensorShape{ 57U, 60U }, |
| 234 | TensorShape{ 128U, 64U }, |
Gian Marco Iodice | 2abb216 | 2018-04-11 10:49:04 +0100 | [diff] [blame] | 235 | TensorShape{ 83U, 72U }, |
| 236 | TensorShape{ 40U, 40U } |
Gian Marco | 37908d9 | 2017-11-07 14:38:22 +0000 | [diff] [blame] | 237 | }) |
| 238 | { |
| 239 | } |
| 240 | }; |
| 241 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 242 | /** Data set containing medium 3D tensor shapes. */ |
| 243 | class Medium3DShapes final : public ShapeDataset |
| 244 | { |
| 245 | public: |
| 246 | Medium3DShapes() |
| 247 | : ShapeDataset("Shape", |
| 248 | { |
| 249 | TensorShape{ 42U, 37U, 8U }, |
| 250 | TensorShape{ 57U, 60U, 13U }, |
| 251 | TensorShape{ 128U, 64U, 21U }, |
| 252 | TensorShape{ 83U, 72U, 14U } |
| 253 | }) |
| 254 | { |
| 255 | } |
| 256 | }; |
| 257 | |
| 258 | /** Data set containing medium 4D tensor shapes. */ |
| 259 | class Medium4DShapes final : public ShapeDataset |
| 260 | { |
| 261 | public: |
| 262 | Medium4DShapes() |
| 263 | : ShapeDataset("Shape", |
| 264 | { |
| 265 | TensorShape{ 42U, 37U, 8U, 15U }, |
| 266 | TensorShape{ 57U, 60U, 13U, 8U }, |
| 267 | TensorShape{ 128U, 64U, 21U, 13U }, |
| 268 | TensorShape{ 83U, 72U, 14U, 5U } |
| 269 | }) |
| 270 | { |
| 271 | } |
| 272 | }; |
| 273 | |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 274 | /** Data set containing large tensor shapes. */ |
| 275 | class LargeShapes final : public ShapeDataset |
| 276 | { |
| 277 | public: |
| 278 | LargeShapes() |
| 279 | : ShapeDataset("Shape", |
| 280 | { |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 281 | // Batch size 1 |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 282 | TensorShape{ 1921U, 1083U }, |
| 283 | TensorShape{ 641U, 485U, 2U, 3U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 284 | // Batch size 4 |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 285 | TensorShape{ 799U, 595U, 1U, 4U }, |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 286 | }) |
| 287 | { |
| 288 | } |
| 289 | }; |
| 290 | |
Diego Lopez Recas | 0021d75 | 2017-12-18 14:42:56 +0000 | [diff] [blame] | 291 | /** Data set containing pairs of large tensor shapes that are broadcast compatible. */ |
| 292 | class LargeShapesBroadcast final : public framework::dataset::ZipDataset<ShapeDataset, ShapeDataset> |
| 293 | { |
| 294 | public: |
| 295 | LargeShapesBroadcast() |
| 296 | : ZipDataset<ShapeDataset, ShapeDataset>( |
| 297 | ShapeDataset("Shape0", |
| 298 | { |
| 299 | TensorShape{ 1921U, 541U }, |
| 300 | TensorShape{ 1U, 485U, 2U, 3U }, |
| 301 | TensorShape{ 4159U, 1U }, |
| 302 | TensorShape{ 799U } |
| 303 | }), |
| 304 | ShapeDataset("Shape1", |
| 305 | { |
| 306 | TensorShape{ 1921U, 1U, 2U }, |
| 307 | TensorShape{ 641U, 1U, 2U, 3U }, |
| 308 | TensorShape{ 1U, 127U, 25U }, |
| 309 | TensorShape{ 799U, 595U, 1U, 4U } |
| 310 | })) |
| 311 | { |
| 312 | } |
| 313 | }; |
| 314 | |
Gian Marco | 5420b28 | 2017-11-29 10:41:38 +0000 | [diff] [blame] | 315 | /** Data set containing large 1D tensor shapes. */ |
| 316 | class Large1DShapes final : public ShapeDataset |
| 317 | { |
| 318 | public: |
| 319 | Large1DShapes() |
| 320 | : ShapeDataset("Shape", |
| 321 | { |
| 322 | TensorShape{ 1921U }, |
| 323 | TensorShape{ 1245U }, |
| 324 | TensorShape{ 4160U } |
| 325 | }) |
| 326 | { |
| 327 | } |
| 328 | }; |
| 329 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 330 | /** Data set containing large 2D tensor shapes. */ |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 331 | class Large2DShapes final : public ShapeDataset |
| 332 | { |
| 333 | public: |
| 334 | Large2DShapes() |
| 335 | : ShapeDataset("Shape", |
| 336 | { |
| 337 | TensorShape{ 1920U, 1080U }, |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 338 | TensorShape{ 1245U, 652U }, |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 339 | TensorShape{ 4160U, 3120U } |
| 340 | }) |
| 341 | { |
| 342 | } |
| 343 | }; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 344 | |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 345 | /** Data set containing large 3D tensor shapes. */ |
| 346 | class Large3DShapes final : public ShapeDataset |
| 347 | { |
| 348 | public: |
| 349 | Large3DShapes() |
| 350 | : ShapeDataset("Shape", |
| 351 | { |
| 352 | TensorShape{ 320U, 240U, 3U }, |
| 353 | TensorShape{ 383U, 653U, 2U }, |
| 354 | TensorShape{ 721U, 123U, 13U } |
| 355 | }) |
| 356 | { |
| 357 | } |
| 358 | }; |
| 359 | |
| 360 | /** Data set containing large 4D tensor shapes. */ |
| 361 | class Large4DShapes final : public ShapeDataset |
| 362 | { |
| 363 | public: |
| 364 | Large4DShapes() |
| 365 | : ShapeDataset("Shape", |
| 366 | { |
| 367 | TensorShape{ 320U, 123U, 3U, 3U }, |
| 368 | TensorShape{ 383U, 413U, 2U, 3U }, |
| 369 | TensorShape{ 517U, 123U, 13U, 2U } |
| 370 | }) |
| 371 | { |
| 372 | } |
| 373 | }; |
| 374 | |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 375 | /** Data set containing small 3x3 tensor shapes. */ |
| 376 | class Small3x3Shapes final : public ShapeDataset |
| 377 | { |
| 378 | public: |
| 379 | Small3x3Shapes() |
| 380 | : ShapeDataset("Shape", |
| 381 | { |
| 382 | TensorShape{ 3U, 3U, 7U, 4U }, |
| 383 | TensorShape{ 3U, 3U, 4U, 13U }, |
| 384 | TensorShape{ 3U, 3U, 9U, 2U }, |
| 385 | TensorShape{ 3U, 3U, 3U, 5U }, |
| 386 | }) |
| 387 | { |
| 388 | } |
| 389 | }; |
| 390 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 391 | /** Data set containing small 3x1 tensor shapes. */ |
| 392 | class Small3x1Shapes final : public ShapeDataset |
| 393 | { |
| 394 | public: |
| 395 | Small3x1Shapes() |
| 396 | : ShapeDataset("Shape", |
| 397 | { |
| 398 | TensorShape{ 3U, 1U, 7U, 4U }, |
| 399 | TensorShape{ 3U, 1U, 4U, 13U }, |
| 400 | TensorShape{ 3U, 1U, 9U, 2U }, |
| 401 | TensorShape{ 3U, 1U, 3U, 5U }, |
| 402 | }) |
| 403 | { |
| 404 | } |
| 405 | }; |
| 406 | |
| 407 | /** Data set containing small 1x3 tensor shapes. */ |
| 408 | class Small1x3Shapes final : public ShapeDataset |
| 409 | { |
| 410 | public: |
| 411 | Small1x3Shapes() |
| 412 | : ShapeDataset("Shape", |
| 413 | { |
| 414 | TensorShape{ 1U, 3U, 7U, 4U }, |
| 415 | TensorShape{ 1U, 3U, 4U, 13U }, |
| 416 | TensorShape{ 1U, 3U, 9U, 2U }, |
| 417 | TensorShape{ 1U, 3U, 3U, 5U }, |
| 418 | }) |
| 419 | { |
| 420 | } |
| 421 | }; |
| 422 | |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 423 | /** Data set containing large 3x3 tensor shapes. */ |
| 424 | class Large3x3Shapes final : public ShapeDataset |
| 425 | { |
| 426 | public: |
| 427 | Large3x3Shapes() |
| 428 | : ShapeDataset("Shape", |
| 429 | { |
| 430 | TensorShape{ 3U, 3U, 32U, 64U }, |
| 431 | TensorShape{ 3U, 3U, 51U, 13U }, |
| 432 | TensorShape{ 3U, 3U, 53U, 47U }, |
| 433 | TensorShape{ 3U, 3U, 128U, 384U }, |
| 434 | }) |
| 435 | { |
| 436 | } |
| 437 | }; |
| 438 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 439 | /** Data set containing large 3x1 tensor shapes. */ |
| 440 | class Large3x1Shapes final : public ShapeDataset |
| 441 | { |
| 442 | public: |
| 443 | Large3x1Shapes() |
| 444 | : ShapeDataset("Shape", |
| 445 | { |
| 446 | TensorShape{ 3U, 1U, 32U, 64U }, |
| 447 | TensorShape{ 3U, 1U, 51U, 13U }, |
| 448 | TensorShape{ 3U, 1U, 53U, 47U }, |
| 449 | TensorShape{ 3U, 1U, 128U, 384U }, |
| 450 | }) |
| 451 | { |
| 452 | } |
| 453 | }; |
| 454 | |
| 455 | /** Data set containing large 1x3 tensor shapes. */ |
| 456 | class Large1x3Shapes final : public ShapeDataset |
| 457 | { |
| 458 | public: |
| 459 | Large1x3Shapes() |
| 460 | : ShapeDataset("Shape", |
| 461 | { |
| 462 | TensorShape{ 1U, 3U, 32U, 64U }, |
| 463 | TensorShape{ 1U, 3U, 51U, 13U }, |
| 464 | TensorShape{ 1U, 3U, 53U, 47U }, |
| 465 | TensorShape{ 1U, 3U, 128U, 384U }, |
| 466 | }) |
| 467 | { |
| 468 | } |
| 469 | }; |
| 470 | |
Giorgio Arena | 9373c8b | 2018-04-11 19:07:17 +0100 | [diff] [blame] | 471 | /** Data set containing small 5x5 tensor shapes. */ |
| 472 | class Small5x5Shapes final : public ShapeDataset |
| 473 | { |
| 474 | public: |
| 475 | Small5x5Shapes() |
| 476 | : ShapeDataset("Shape", |
| 477 | { |
| 478 | TensorShape{ 5U, 5U, 7U, 4U }, |
| 479 | TensorShape{ 5U, 5U, 4U, 13U }, |
| 480 | TensorShape{ 5U, 5U, 9U, 2U }, |
| 481 | TensorShape{ 5U, 5U, 3U, 5U }, |
| 482 | }) |
| 483 | { |
| 484 | } |
| 485 | }; |
| 486 | |
| 487 | /** Data set containing large 5x5 tensor shapes. */ |
| 488 | class Large5x5Shapes final : public ShapeDataset |
| 489 | { |
| 490 | public: |
| 491 | Large5x5Shapes() |
| 492 | : ShapeDataset("Shape", |
| 493 | { |
| 494 | TensorShape{ 5U, 5U, 32U, 64U }, |
| 495 | TensorShape{ 5U, 5U, 51U, 13U }, |
| 496 | TensorShape{ 5U, 5U, 53U, 47U }, |
| 497 | TensorShape{ 5U, 5U, 128U, 384U }, |
| 498 | }) |
| 499 | { |
| 500 | } |
| 501 | }; |
| 502 | |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 503 | /** Data set containing small 5x1 tensor shapes. */ |
| 504 | class Small5x1Shapes final : public ShapeDataset |
| 505 | { |
| 506 | public: |
| 507 | Small5x1Shapes() |
| 508 | : ShapeDataset("Shape", |
| 509 | { |
| 510 | TensorShape{ 5U, 1U, 7U, 4U }, |
| 511 | TensorShape{ 5U, 1U, 4U, 13U }, |
| 512 | TensorShape{ 5U, 1U, 9U, 2U }, |
| 513 | TensorShape{ 5U, 1U, 3U, 5U }, |
| 514 | }) |
| 515 | { |
| 516 | } |
| 517 | }; |
| 518 | |
| 519 | /** Data set containing large 5x1 tensor shapes. */ |
| 520 | class Large5x1Shapes final : public ShapeDataset |
| 521 | { |
| 522 | public: |
| 523 | Large5x1Shapes() |
| 524 | : ShapeDataset("Shape", |
| 525 | { |
| 526 | TensorShape{ 5U, 1U, 32U, 64U }, |
| 527 | TensorShape{ 5U, 1U, 51U, 13U }, |
| 528 | TensorShape{ 5U, 1U, 53U, 47U }, |
| 529 | TensorShape{ 5U, 1U, 128U, 384U }, |
| 530 | }) |
| 531 | { |
| 532 | } |
| 533 | }; |
| 534 | |
| 535 | /** Data set containing small 1x5 tensor shapes. */ |
| 536 | class Small1x5Shapes final : public ShapeDataset |
| 537 | { |
| 538 | public: |
| 539 | Small1x5Shapes() |
| 540 | : ShapeDataset("Shape", |
| 541 | { |
| 542 | TensorShape{ 1U, 5U, 7U, 4U }, |
| 543 | TensorShape{ 1U, 5U, 4U, 13U }, |
| 544 | TensorShape{ 1U, 5U, 9U, 2U }, |
| 545 | TensorShape{ 1U, 5U, 3U, 5U }, |
| 546 | }) |
| 547 | { |
| 548 | } |
| 549 | }; |
| 550 | |
| 551 | /** Data set containing large 1x5 tensor shapes. */ |
| 552 | class Large1x5Shapes final : public ShapeDataset |
| 553 | { |
| 554 | public: |
| 555 | Large1x5Shapes() |
| 556 | : ShapeDataset("Shape", |
| 557 | { |
| 558 | TensorShape{ 1U, 5U, 32U, 64U }, |
| 559 | TensorShape{ 1U, 5U, 51U, 13U }, |
| 560 | TensorShape{ 1U, 5U, 53U, 47U }, |
| 561 | TensorShape{ 1U, 5U, 128U, 384U }, |
| 562 | }) |
| 563 | { |
| 564 | } |
| 565 | }; |
| 566 | |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 567 | /** Data set containing small tensor shapes for deconvolution. */ |
| 568 | class SmallDeconvolutionShapes final : public ShapeDataset |
| 569 | { |
| 570 | public: |
| 571 | SmallDeconvolutionShapes() |
| 572 | : ShapeDataset("InputShape", |
| 573 | { |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 574 | TensorShape{ 5U, 4U, 3U, 2U }, |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 575 | TensorShape{ 5U, 5U, 3U }, |
| 576 | TensorShape{ 11U, 13U, 4U, 3U } |
| 577 | }) |
| 578 | { |
| 579 | } |
| 580 | }; |
| 581 | |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 582 | /** Data set containing tiny tensor shapes for direct convolution. */ |
| 583 | class TinyDirectConvolutionShapes final : public ShapeDataset |
| 584 | { |
| 585 | public: |
| 586 | TinyDirectConvolutionShapes() |
| 587 | : ShapeDataset("InputShape", |
| 588 | { |
| 589 | // Batch size 1 |
| 590 | TensorShape{ 11U, 13U, 3U }, |
| 591 | TensorShape{ 7U, 27U, 3U } |
| 592 | }) |
| 593 | { |
| 594 | } |
| 595 | }; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 596 | /** Data set containing small tensor shapes for direct convolution. */ |
| 597 | class SmallDirectConvolutionShapes final : public ShapeDataset |
| 598 | { |
| 599 | public: |
| 600 | SmallDirectConvolutionShapes() |
| 601 | : ShapeDataset("InputShape", |
| 602 | { |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 603 | // Batch size 1 |
steniu01 | f81652d | 2017-09-11 15:29:12 +0100 | [diff] [blame] | 604 | TensorShape{ 35U, 35U, 3U }, |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 605 | TensorShape{ 32U, 37U, 3U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 606 | // Batch size 4 |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 607 | TensorShape{ 32U, 37U, 3U, 4U }, |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 608 | // Batch size 8 |
SiCong Li | caf8c5e | 2017-08-21 13:12:52 +0100 | [diff] [blame] | 609 | TensorShape{ 32U, 37U, 3U, 8U }, |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 610 | TensorShape{ 33U, 35U, 8U, 8U } |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 611 | }) |
| 612 | { |
| 613 | } |
| 614 | }; |
Gian Marco Iodice | b2833b8 | 2017-09-13 16:23:18 +0100 | [diff] [blame] | 615 | |
Xinghang Zhou | 33ff9ef | 2018-01-17 11:23:39 +0800 | [diff] [blame] | 616 | /** Data set containing small tensor shapes for direct convolution. */ |
| 617 | class SmallDirectConvolutionTensorShiftShapes final : public ShapeDataset |
| 618 | { |
| 619 | public: |
| 620 | SmallDirectConvolutionTensorShiftShapes() |
| 621 | : ShapeDataset("InputShape", |
| 622 | { |
| 623 | // Batch size 1 |
| 624 | TensorShape{ 35U, 35U, 3U }, |
| 625 | TensorShape{ 32U, 37U, 3U }, |
| 626 | // Batch size 4 |
| 627 | TensorShape{ 32U, 37U, 3U, 4U }, |
| 628 | // Batch size 8 |
| 629 | TensorShape{ 32U, 37U, 3U, 8U }, |
| 630 | TensorShape{ 33U, 35U, 3U, 8U }, |
| 631 | // Arbitrary batch size |
| 632 | TensorShape{ 32U, 37U, 3U, 8U } |
| 633 | }) |
| 634 | { |
| 635 | } |
| 636 | }; |
| 637 | |
Giorgio Arena | 0f17039 | 2018-07-18 16:13:12 +0100 | [diff] [blame] | 638 | /** Data set containing small grouped im2col tensor shapes. */ |
| 639 | class GroupedIm2ColSmallShapes final : public ShapeDataset |
| 640 | { |
| 641 | public: |
| 642 | GroupedIm2ColSmallShapes() |
| 643 | : ShapeDataset("Shape", |
| 644 | { |
| 645 | TensorShape{ 11U, 11U, 48U }, |
| 646 | TensorShape{ 27U, 13U, 24U }, |
| 647 | TensorShape{ 128U, 64U, 12U, 3U }, |
| 648 | TensorShape{ 11U, 11U, 48U, 4U }, |
| 649 | TensorShape{ 27U, 13U, 24U, 4U }, |
| 650 | TensorShape{ 11U, 11U, 48U, 5U } |
| 651 | }) |
| 652 | { |
| 653 | } |
| 654 | }; |
| 655 | |
| 656 | /** Data set containing large grouped im2col tensor shapes. */ |
| 657 | class GroupedIm2ColLargeShapes final : public ShapeDataset |
| 658 | { |
| 659 | public: |
| 660 | GroupedIm2ColLargeShapes() |
| 661 | : ShapeDataset("Shape", |
| 662 | { |
| 663 | TensorShape{ 1921U, 1083U, 12U }, |
| 664 | TensorShape{ 641U, 485U, 24U, 3U }, |
| 665 | TensorShape{ 799U, 595U, 12U, 4U }, |
| 666 | }) |
| 667 | { |
| 668 | } |
| 669 | }; |
| 670 | |
Giorgio Arena | c6aa49b | 2018-08-07 11:53:30 +0100 | [diff] [blame] | 671 | /** Data set containing small grouped weights tensor shapes. */ |
| 672 | class GroupedWeightsSmallShapes final : public ShapeDataset |
| 673 | { |
| 674 | public: |
| 675 | GroupedWeightsSmallShapes() |
| 676 | : ShapeDataset("Shape", |
| 677 | { |
| 678 | TensorShape{ 3U, 3U, 48U, 120U }, |
| 679 | TensorShape{ 1U, 3U, 24U, 240U }, |
| 680 | TensorShape{ 3U, 1U, 12U, 480U }, |
| 681 | TensorShape{ 5U, 5U, 48U, 120U }, |
| 682 | TensorShape{ 1U, 5U, 24U, 240U }, |
| 683 | TensorShape{ 5U, 1U, 48U, 480U } |
| 684 | }) |
| 685 | { |
| 686 | } |
| 687 | }; |
| 688 | |
| 689 | /** Data set containing large grouped weights tensor shapes. */ |
| 690 | class GroupedWeightsLargeShapes final : public ShapeDataset |
| 691 | { |
| 692 | public: |
| 693 | GroupedWeightsLargeShapes() |
| 694 | : ShapeDataset("Shape", |
| 695 | { |
| 696 | TensorShape{ 9U, 9U, 96U, 240U }, |
| 697 | TensorShape{ 7U, 9U, 48U, 480U }, |
| 698 | TensorShape{ 9U, 7U, 24U, 960U }, |
| 699 | TensorShape{ 13U, 13U, 96U, 240U }, |
| 700 | TensorShape{ 11U, 13U, 48U, 480U }, |
| 701 | TensorShape{ 13U, 11U, 24U, 960U } |
| 702 | }) |
| 703 | { |
| 704 | } |
| 705 | }; |
| 706 | |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 707 | /** Data set containing 2D tensor shapes for DepthConcatenateLayer. */ |
| 708 | class DepthConcatenateLayerShapes final : public ShapeDataset |
Gian Marco Iodice | b2833b8 | 2017-09-13 16:23:18 +0100 | [diff] [blame] | 709 | { |
| 710 | public: |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 711 | DepthConcatenateLayerShapes() |
Gian Marco Iodice | b2833b8 | 2017-09-13 16:23:18 +0100 | [diff] [blame] | 712 | : ShapeDataset("Shape", |
| 713 | { |
| 714 | TensorShape{ 322U, 243U }, |
| 715 | TensorShape{ 463U, 879U }, |
| 716 | TensorShape{ 416U, 651U } |
| 717 | }) |
| 718 | { |
| 719 | } |
| 720 | }; |
| 721 | |
Michalis Spyrou | 55b3d12 | 2018-05-09 09:59:23 +0100 | [diff] [blame] | 722 | /** Data set containing tensor shapes for WidthConcatenateLayer. */ |
| 723 | class WidthConcatenateLayerShapes final : public ShapeDataset |
| 724 | { |
| 725 | public: |
| 726 | WidthConcatenateLayerShapes() |
| 727 | : ShapeDataset("Shape", |
| 728 | { |
| 729 | TensorShape{ 232U, 65U, 3U }, |
| 730 | TensorShape{ 432U, 65U, 3U }, |
| 731 | TensorShape{ 124U, 65U, 3U } |
| 732 | }) |
| 733 | { |
| 734 | } |
| 735 | }; |
| 736 | |
Gian Marco Iodice | bf17955 | 2017-09-05 13:51:21 +0100 | [diff] [blame] | 737 | /** Data set containing global pooling tensor shapes. */ |
| 738 | class GlobalPoolingShapes final : public ShapeDataset |
| 739 | { |
| 740 | public: |
| 741 | GlobalPoolingShapes() |
| 742 | : ShapeDataset("Shape", |
| 743 | { |
| 744 | // Batch size 1 |
| 745 | TensorShape{ 9U, 9U }, |
| 746 | TensorShape{ 13U, 13U, 2U }, |
| 747 | TensorShape{ 27U, 27U, 1U, 3U }, |
| 748 | // Batch size 4 |
| 749 | TensorShape{ 31U, 31U, 3U, 4U }, |
| 750 | TensorShape{ 34U, 34U, 2U, 4U } |
| 751 | }) |
| 752 | { |
| 753 | } |
| 754 | }; |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 755 | /** Data set containing tiny softmax layer shapes. */ |
| 756 | class SoftmaxLayerTinyShapes final : public ShapeDataset |
| 757 | { |
| 758 | public: |
| 759 | SoftmaxLayerTinyShapes() |
| 760 | : ShapeDataset("Shape", |
| 761 | { |
| 762 | TensorShape{ 9U, 9U }, |
Georgios Pinitas | 17d6d3c | 2018-07-02 17:52:40 +0100 | [diff] [blame] | 763 | TensorShape{ 128U, 10U }, |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 764 | }) |
| 765 | { |
| 766 | } |
| 767 | }; |
Gian Marco Iodice | bf17955 | 2017-09-05 13:51:21 +0100 | [diff] [blame] | 768 | |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 769 | /** Data set containing small softmax layer shapes. */ |
| 770 | class SoftmaxLayerSmallShapes final : public ShapeDataset |
| 771 | { |
| 772 | public: |
| 773 | SoftmaxLayerSmallShapes() |
| 774 | : ShapeDataset("Shape", |
| 775 | { |
| 776 | TensorShape{ 9U, 9U }, |
Georgios Pinitas | 17d6d3c | 2018-07-02 17:52:40 +0100 | [diff] [blame] | 777 | TensorShape{ 256U, 10U }, |
| 778 | TensorShape{ 353U, 8U }, |
| 779 | TensorShape{ 781U, 5U }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 780 | }) |
| 781 | { |
| 782 | } |
| 783 | }; |
| 784 | |
| 785 | /** Data set containing large softmax layer shapes. */ |
| 786 | class SoftmaxLayerLargeShapes final : public ShapeDataset |
| 787 | { |
| 788 | public: |
| 789 | SoftmaxLayerLargeShapes() |
| 790 | : ShapeDataset("Shape", |
| 791 | { |
| 792 | TensorShape{ 1000U, 10U }, |
Georgios Pinitas | 17d6d3c | 2018-07-02 17:52:40 +0100 | [diff] [blame] | 793 | TensorShape{ 3989U, 10U }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 794 | TensorShape{ 7339U, 11U }, |
| 795 | }) |
| 796 | { |
| 797 | } |
| 798 | }; |
| 799 | |
Ioan-Cristian Szabo | 2c35018 | 2017-12-20 16:27:37 +0000 | [diff] [blame] | 800 | /** Data set containing 2D tensor shapes relative to an image size. */ |
| 801 | class SmallImageShapes final : public ShapeDataset |
| 802 | { |
| 803 | public: |
| 804 | SmallImageShapes() |
| 805 | : ShapeDataset("Shape", |
| 806 | { |
| 807 | TensorShape{ 640U, 480U }, |
| 808 | TensorShape{ 800U, 600U }, |
| 809 | TensorShape{ 1200U, 800U } |
| 810 | }) |
| 811 | { |
| 812 | } |
| 813 | }; |
| 814 | |
| 815 | /** Data set containing 2D tensor shapes relative to an image size. */ |
| 816 | class LargeImageShapes final : public ShapeDataset |
| 817 | { |
| 818 | public: |
| 819 | LargeImageShapes() |
| 820 | : ShapeDataset("Shape", |
| 821 | { |
| 822 | TensorShape{ 1920U, 1080U }, |
| 823 | TensorShape{ 2560U, 1536U }, |
| 824 | TensorShape{ 3584U, 2048U } |
| 825 | }) |
| 826 | { |
| 827 | } |
| 828 | }; |
Moritz Pflanzer | f6ad98a | 2017-07-21 17:19:58 +0100 | [diff] [blame] | 829 | } // namespace datasets |
| 830 | } // namespace test |
| 831 | } // namespace arm_compute |
| 832 | #endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */ |