ArmNN
 21.08
StackTestImpl.cpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > StackAxis0TestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > StackOutput4DAxis1TestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > StackOutput4DAxis2TestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > StackOutput4DAxis3TestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 3 > StackOutput3DInputs3TestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 5 > StackOutput5DTestImpl (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > StackAxis0Float32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > StackOutput4DAxis1Float32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > StackOutput4DAxis2Float32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > StackOutput4DAxis3Float32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 3 > StackOutput3DInputs3Float32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 5 > StackOutput5DFloat32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > StackFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ StackAxis0Float32Test()

LayerTestResult<float, 4> StackAxis0Float32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 519 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

523 {
524  return StackAxis0TestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
525 }

◆ StackAxis0TestImpl()

LayerTestResult<T, 4> StackAxis0TestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 87 of file StackTestImpl.cpp.

91 {
92  armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType);
93  armnn::TensorInfo outputTensorInfo({ 2, 3, 2, 3 }, ArmnnType);
94 
95  std::vector<std::vector<T>> inputData;
96 
97  inputData.push_back(
98  {
99  1, 2, 3,
100  4, 5, 6,
101 
102  7, 8, 9,
103  10, 11, 12,
104 
105  13, 14, 15,
106  16, 17, 18
107  });
108 
109  inputData.push_back(
110  {
111  19, 20, 21,
112  22, 23, 24,
113 
114  25, 26, 27,
115  28, 29, 30,
116 
117  31, 32, 33,
118  34, 35, 36
119  });
120 
121  std::vector<T> outputExpectedData =
122  {
123  1, 2, 3,
124  4, 5, 6,
125 
126  7, 8, 9,
127  10, 11, 12,
128 
129  13, 14, 15,
130  16, 17, 18,
131 
132 
133  19, 20, 21,
134  22, 23, 24,
135 
136  25, 26, 27,
137  28, 29, 30,
138 
139  31, 32, 33,
140  34, 35, 36
141  };
142 
143  return StackTestHelper<ArmnnType, T, 4>(
144  workloadFactory,
145  memoryManager,
146  tensorHandleFactory,
147  inputTensorInfo,
148  outputTensorInfo,
149  0U,
150  inputData,
151  outputExpectedData
152  );
153 }

◆ StackFloat16Test()

LayerTestResult<armnn::Half, 4> StackFloat16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 567 of file StackTestImpl.cpp.

References armnn::Float16.

Referenced by TEST_SUITE().

571 {
572  using namespace half_float::literal;
573 
574  armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, armnn::DataType::Float16);
575  armnn::TensorInfo outputTensorInfo({ 3, 2, 2, 3 }, armnn::DataType::Float16);
576 
577  std::vector<std::vector<armnn::Half>> inputData;
578 
579  inputData.push_back(
580  {
581  1.0_h, 2.0_h, 3.0_h,
582  4.0_h, 5.0_h, 6.0_h,
583 
584  7.0_h, 8.0_h, 9.0_h,
585  10.0_h, 11.0_h, 12.0_h,
586 
587  13.0_h, 14.0_h, 15.0_h,
588  16.0_h, 17.0_h, 18.0_h
589  });
590 
591  inputData.push_back(
592  {
593  19.0_h, 20.0_h, 21.0_h,
594  22.0_h, 23.0_h, 24.0_h,
595 
596  25.0_h, 26.0_h, 27.0_h,
597  28.0_h, 29.0_h, 30.0_h,
598 
599  31.0_h, 32.0_h, 33.0_h,
600  34.0_h, 35.0_h, 36.0_h
601  });
602 
603  std::vector<armnn::Half> outputExpectedData =
604  {
605  1.0_h, 2.0_h, 3.0_h,
606  19.0_h, 20.0_h, 21.0_h,
607 
608  4.0_h, 5.0_h, 6.0_h,
609  22.0_h, 23.0_h, 24.0_h,
610 
611  7.0_h, 8.0_h, 9.0_h,
612  25.0_h, 26.0_h, 27.0_h,
613 
614  10.0_h, 11.0_h, 12.0_h,
615  28.0_h, 29.0_h, 30.0_h,
616 
617  13.0_h, 14.0_h, 15.0_h,
618  31.0_h, 32.0_h, 33.0_h,
619 
620  16.0_h, 17.0_h, 18.0_h,
621  34.0_h, 35.0_h, 36.0_h
622  };
623 
624  return StackTestHelper<armnn::DataType::Float16, armnn::Half, 4>(
625  workloadFactory,
626  memoryManager,
627  tensorHandleFactory,
628  inputTensorInfo,
629  outputTensorInfo,
630  2U,
631  inputData,
632  outputExpectedData
633  );
634 }

◆ StackOutput3DInputs3Float32Test()

LayerTestResult<float, 3> StackOutput3DInputs3Float32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 551 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

555 {
556  return StackOutput3DInputs3TestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
557 }

◆ StackOutput3DInputs3TestImpl()

LayerTestResult<T, 3> StackOutput3DInputs3TestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 370 of file StackTestImpl.cpp.

374 {
375  armnn::TensorInfo inputTensorInfo ({ 3, 3 }, ArmnnType);
376  armnn::TensorInfo outputTensorInfo({ 3, 3, 3 }, ArmnnType);
377 
378  std::vector<std::vector<T>> inputData;
379 
380  inputData.push_back(
381  {
382  1, 2, 3,
383  4, 5, 6,
384  7, 8, 9
385  });
386 
387  inputData.push_back(
388  {
389  10, 11, 12,
390  13, 14, 15,
391  16, 17, 18
392  });
393 
394  inputData.push_back(
395  {
396  19, 20, 21,
397  22, 23, 24,
398  25, 26, 27
399  });
400 
401  std::vector<T> outputExpectedData =
402  {
403  1, 2, 3,
404  10, 11, 12,
405  19, 20, 21,
406 
407  4, 5, 6,
408  13, 14, 15,
409  22, 23, 24,
410 
411  7, 8, 9,
412  16, 17, 18,
413  25, 26, 27
414  };
415 
416  return StackTestHelper<ArmnnType, T, 3>(
417  workloadFactory,
418  memoryManager,
419  tensorHandleFactory,
420  inputTensorInfo,
421  outputTensorInfo,
422  1U,
423  inputData,
424  outputExpectedData
425  );
426 }

◆ StackOutput4DAxis1Float32Test()

LayerTestResult<float, 4> StackOutput4DAxis1Float32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 527 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

531 {
532  return StackOutput4DAxis1TestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
533 }

◆ StackOutput4DAxis1TestImpl()

LayerTestResult<T, 4> StackOutput4DAxis1TestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 156 of file StackTestImpl.cpp.

160 {
161  armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType);
162  armnn::TensorInfo outputTensorInfo({ 3, 2, 2, 3 }, ArmnnType);
163 
164  std::vector<std::vector<T>> inputData;
165 
166  inputData.push_back(
167  {
168  1, 2, 3,
169  4, 5, 6,
170 
171  7, 8, 9,
172  10, 11, 12,
173 
174  13, 14, 15,
175  16, 17, 18
176  });
177 
178  inputData.push_back(
179  {
180  19, 20, 21,
181  22, 23, 24,
182 
183  25, 26, 27,
184  28, 29, 30,
185 
186  31, 32, 33,
187  34, 35, 36
188  });
189 
190  std::vector<T> outputExpectedData =
191  {
192  1, 2, 3,
193  4, 5, 6,
194 
195  19, 20, 21,
196  22, 23, 24,
197 
198 
199  7, 8, 9,
200  10, 11, 12,
201 
202  25, 26, 27,
203  28, 29, 30,
204 
205 
206  13, 14, 15,
207  16, 17, 18,
208 
209  31, 32, 33,
210  34, 35, 36
211  };
212 
213  return StackTestHelper<ArmnnType, T, 4>(
214  workloadFactory,
215  memoryManager,
216  tensorHandleFactory,
217  inputTensorInfo,
218  outputTensorInfo,
219  1U,
220  inputData,
221  outputExpectedData
222  );
223 }

◆ StackOutput4DAxis2Float32Test()

LayerTestResult<float, 4> StackOutput4DAxis2Float32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 535 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

539 {
540  return StackOutput4DAxis2TestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
541 }

◆ StackOutput4DAxis2TestImpl()

LayerTestResult<T, 4> StackOutput4DAxis2TestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 226 of file StackTestImpl.cpp.

230 {
231  armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType);
232  armnn::TensorInfo outputTensorInfo({ 3, 2, 2, 3 }, ArmnnType);
233 
234  std::vector<std::vector<T>> inputData;
235 
236  inputData.push_back(
237  {
238  1, 2, 3,
239  4, 5, 6,
240 
241  7, 8, 9,
242  10, 11, 12,
243 
244  13, 14, 15,
245  16, 17, 18
246  });
247 
248  inputData.push_back(
249  {
250  19, 20, 21,
251  22, 23, 24,
252 
253  25, 26, 27,
254  28, 29, 30,
255 
256  31, 32, 33,
257  34, 35, 36
258  });
259 
260  std::vector<T> outputExpectedData =
261  {
262  1, 2, 3,
263  19, 20, 21,
264 
265  4, 5, 6,
266  22, 23, 24,
267 
268  7, 8, 9,
269  25, 26, 27,
270 
271  10, 11, 12,
272  28, 29, 30,
273 
274  13, 14, 15,
275  31, 32, 33,
276 
277  16, 17, 18,
278  34, 35, 36
279  };
280 
281  return StackTestHelper<ArmnnType, T, 4>(
282  workloadFactory,
283  memoryManager,
284  tensorHandleFactory,
285  inputTensorInfo,
286  outputTensorInfo,
287  2U,
288  inputData,
289  outputExpectedData
290  );
291 }

◆ StackOutput4DAxis3Float32Test()

LayerTestResult<float, 4> StackOutput4DAxis3Float32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 543 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

547 {
548  return StackOutput4DAxis3TestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
549 }

◆ StackOutput4DAxis3TestImpl()

LayerTestResult<T, 4> StackOutput4DAxis3TestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 294 of file StackTestImpl.cpp.

298 {
299  armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType);
300  armnn::TensorInfo outputTensorInfo({ 3, 2, 3, 2 }, ArmnnType);
301 
302  std::vector<std::vector<T>> inputData;
303 
304  inputData.push_back(
305  {
306  1, 2, 3,
307  4, 5, 6,
308 
309  7, 8, 9,
310  10, 11, 12,
311 
312  13, 14, 15,
313  16, 17, 18
314  });
315 
316  inputData.push_back(
317  {
318  19, 20, 21,
319  22, 23, 24,
320 
321  25, 26, 27,
322  28, 29, 30,
323 
324  31, 32, 33,
325  34, 35, 36
326  });
327 
328  std::vector<T> outputExpectedData =
329  {
330  1, 19,
331  2, 20,
332  3, 21,
333 
334  4, 22,
335  5, 23,
336  6, 24,
337 
338 
339  7, 25,
340  8, 26,
341  9, 27,
342 
343  10, 28,
344  11, 29,
345  12, 30,
346 
347 
348  13, 31,
349  14, 32,
350  15, 33,
351 
352  16, 34,
353  17, 35,
354  18, 36
355  };
356 
357  return StackTestHelper<ArmnnType, T, 4>(
358  workloadFactory,
359  memoryManager,
360  tensorHandleFactory,
361  inputTensorInfo,
362  outputTensorInfo,
363  3U,
364  inputData,
365  outputExpectedData
366  );
367 }

◆ StackOutput5DFloat32Test()

LayerTestResult<float, 5> StackOutput5DFloat32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 559 of file StackTestImpl.cpp.

Referenced by TEST_SUITE().

563 {
564  return StackOutput5DTestImpl<armnn::DataType::Float32>(workloadFactory, memoryManager, tensorHandleFactory);
565 }

◆ StackOutput5DTestImpl()

LayerTestResult<T, 5> StackOutput5DTestImpl ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 429 of file StackTestImpl.cpp.

433 {
434  armnn::TensorInfo inputTensorInfo ({ 2, 2, 2, 3 }, ArmnnType);
435  armnn::TensorInfo outputTensorInfo({ 2, 2, 2, 2, 3 }, ArmnnType);
436 
437  std::vector<std::vector<T>> inputData;
438 
439  inputData.push_back(
440  {
441  1, 2, 3,
442  4, 5, 6,
443 
444  7, 8, 9,
445  10, 11, 12,
446 
447 
448  13, 14, 15,
449  16, 17, 18,
450 
451  19, 20, 21,
452  22, 23, 24
453  });
454 
455  inputData.push_back(
456  {
457  25, 26, 27,
458  28, 29, 30,
459 
460  31, 32, 33,
461  34, 35, 36,
462 
463 
464  37, 38, 39,
465  40, 41, 42,
466 
467  43, 44, 45,
468  46, 47, 48
469  });
470 
471  std::vector<T> outputExpectedData =
472  {
473  1, 2, 3,
474  4, 5, 6,
475 
476  7, 8, 9,
477  10, 11, 12,
478 
479 
480  25, 26, 27,
481  28, 29, 30,
482 
483  31, 32, 33,
484  34, 35, 36,
485 
486 
487 
488  13, 14, 15,
489  16, 17, 18,
490 
491  19, 20, 21,
492  22, 23, 24,
493 
494 
495  37, 38, 39,
496  40, 41, 42,
497 
498  43, 44, 45,
499  46, 47, 48
500 
501  };
502 
503  return StackTestHelper<ArmnnType, T, 5>(
504  workloadFactory,
505  memoryManager,
506  tensorHandleFactory,
507  inputTensorInfo,
508  outputTensorInfo,
509  1U,
510  inputData,
511  outputExpectedData
512  );
513 }