ArmNN
 21.11
ResizeTestImpl.hpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeBilinearNopTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > SimpleResizeBilinearTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeBilinearSqMinTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeBilinearMinTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeBilinearMagTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeNearestNeighborNopTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > SimpleResizeNearestNeighborTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeNearestNeighborSqMinTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeNearestNeighborMinTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > ResizeNearestNeighborMagTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout, float inQuantScale, int32_t inQuantOffset, float outQuantScale, int32_t outQuantOffset)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > HalfPixelCentersResizeBilinearTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > AlignCornersResizeBilinearTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > HalfPixelCentersResizeNearestNeighbourTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > AlignCornersResizeNearestNeighbourTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, const armnn::DataLayout dataLayout)
 

Function Documentation

◆ AlignCornersResizeBilinearTest()

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

Definition at line 587 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

592 {
593  ResizeTestParams testParams;
594  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
595  testParams.m_DataLayout = dataLayout;
596  testParams.m_AlignCorners = true;
597 
598  testParams.m_InputShape = { 1, 1, 2, 2 };
599  testParams.m_OutputShape = { 1, 1, 1, 1 };
600 
601  testParams.m_InputData =
602  {
603  1.0f, 2.0f,
604  3.0f, 4.0f,
605  };
606 
607  testParams.m_ExpectedOutputData =
608  {
609  1.0f
610  };
611 
612  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
613 }

◆ AlignCornersResizeNearestNeighbourTest()

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

Definition at line 647 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

652 {
653  ResizeTestParams testParams;
654  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
655  testParams.m_DataLayout = dataLayout;
656  testParams.m_AlignCorners = true;
657 
658  testParams.m_InputShape = { 1, 1, 2, 2 };
659  testParams.m_OutputShape = { 1, 1, 1, 1 };
660 
661  testParams.m_InputData =
662  {
663  1.0f, 2.0f,
664  3.0f, 4.0f,
665  };
666 
667  testParams.m_ExpectedOutputData =
668  {
669  1.0f
670  };
671 
672  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
673 }

◆ HalfPixelCentersResizeBilinearTest()

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

Definition at line 549 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

554 {
555  ResizeTestParams testParams;
556  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
557  testParams.m_DataLayout = dataLayout;
558  testParams.m_HalfPixelCenters = true;
559 
560  testParams.m_InputShape = { 2, 1, 2, 2 };
561  testParams.m_OutputShape = { 2, 1, 3, 3 };
562 
563  testParams.m_InputData =
564  {
565  1.0f, 2.0f,
566  3.0f, 4.0f,
567 
568  1.0f, 2.0f,
569  3.0f, 4.0f
570  };
571 
572  testParams.m_ExpectedOutputData =
573  {
574  1.0f, 1.5f, 2.0f,
575  2.0f, 2.5f, 3.0f,
576  3.0f, 3.5f, 4.0f,
577 
578  1.0f, 1.5f, 2.0f,
579  2.0f, 2.5f, 3.0f,
580  3.0f, 3.5f, 4.0f,
581  };
582 
583  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
584 }

◆ HalfPixelCentersResizeNearestNeighbourTest()

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

Definition at line 616 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

621 {
622  ResizeTestParams testParams;
623  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
624  testParams.m_DataLayout = dataLayout;
625  testParams.m_HalfPixelCenters = true;
626 
627  testParams.m_InputShape = { 1, 1, 2, 5 };
628  testParams.m_OutputShape = { 1, 1, 2, 2 };
629 
630  testParams.m_InputData =
631  {
632  1.0f, 2.0f, 3.0f, 4.0f, 5.0f,
633 
634  1.0f, 2.0f, 3.0f, 4.0f, 5.0f
635  };
636 
637  testParams.m_ExpectedOutputData =
638  {
639  2.0f, 4.0f,
640  2.0f, 4.0f
641  };
642 
643  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
644 }

◆ ResizeBilinearMagTest()

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

Definition at line 304 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

309 {
310  ResizeTestParams testParams;
311  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
312  testParams.m_DataLayout = dataLayout;
313 
314  testParams.m_InputShape = { 1, 2, 3, 2 };
315  testParams.m_OutputShape = { 1, 2, 3, 5 };
316 
317  testParams.m_InputData =
318  {
319  1.0f, 2.0f,
320  13.0f, 21.0f,
321  144.0f, 233.0f,
322 
323  233.0f, 144.0f,
324  21.0f, 13.0f,
325  2.0f, 1.0f
326  };
327 
328  testParams.m_ExpectedOutputData =
329  {
330  1.0f, 1.4f, 1.8f, 2.0f, 2.0f,
331  13.0f, 16.2f, 19.4f, 21.0f, 21.0f,
332  144.0f, 179.6f, 215.2f, 233.0f, 233.0f,
333 
334  233.0f, 197.4f, 161.8f, 144.0f, 144.0f,
335  21.0f, 17.8f, 14.6f, 13.0f, 13.0f,
336  2.0f, 1.6f, 1.2f, 1.0f, 1.0f
337  };
338 
339  testParams.SetInQuantParams(1.0f, 0);
340 
341  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
342 }

◆ ResizeBilinearMinTest()

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

Definition at line 265 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

270 {
271  ResizeTestParams testParams;
272  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
273  testParams.m_DataLayout = dataLayout;
274 
275  testParams.m_InputShape = { 1, 2, 3, 5 };
276  testParams.m_OutputShape = { 1, 2, 2, 3 };
277 
278  testParams.m_InputData =
279  {
280  1.5f, 3.0f, 4.5f, 6.0f, 7.5f,
281  9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
282  16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
283 
284  16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
285  9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
286  1.5f, 3.0f, 4.5f, 6.0f, 7.5f
287  };
288 
289  testParams.m_ExpectedOutputData =
290  {
291  1.50f, 4.00f, 6.50f,
292  12.75f, 15.25f, 17.75f,
293 
294  16.50f, 19.00f, 21.50f,
295  5.25f, 7.75f, 10.25f
296  };
297 
298  testParams.SetInOutQuantParams(1.5f, -1);
299 
300  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
301 }

◆ ResizeBilinearNopTest()

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

Definition at line 150 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

155 {
156  ResizeTestParams testParams;
157  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
158  testParams.m_DataLayout = dataLayout;
159 
160  testParams.m_InputShape = { 1, 2, 4, 4 };
161  testParams.m_OutputShape = testParams.m_InputShape;
162 
163  testParams.m_InputData =
164  {
165  1.0f, 2.0f, 3.0f, 4.0f,
166  2.0f, 3.0f, 4.0f, 5.0f,
167  3.0f, 4.0f, 5.0f, 6.0f,
168  4.0f, 5.0f, 6.0f, 7.0f,
169 
170  1.0f, 2.0f, 3.0f, 4.0f,
171  2.0f, 3.0f, 4.0f, 5.0f,
172  3.0f, 4.0f, 5.0f, 6.0f,
173  4.0f, 5.0f, 6.0f, 7.0f
174  };
175 
176  testParams.m_ExpectedOutputData = testParams.m_InputData;
177 
178  testParams.SetInOutQuantParams(1.5f, 3);
179 
180  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
181 }

◆ ResizeBilinearSqMinTest()

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

Definition at line 224 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

229 {
230  ResizeTestParams testParams;
231  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
232  testParams.m_DataLayout = dataLayout;
233 
234  testParams.m_InputShape = { 1, 2, 4, 4 };
235  testParams.m_OutputShape = { 1, 2, 2, 2 };
236 
237  testParams.m_InputData =
238  {
239  1.0f, 2.0f, 3.0f, 4.0f,
240  2.0f, 3.0f, 4.0f, 5.0f,
241  3.0f, 4.0f, 5.0f, 6.0f,
242  4.0f, 5.0f, 6.0f, 7.0f,
243 
244  7.0f, 6.0f, 5.0f, 4.0f,
245  6.0f, 5.0f, 4.0f, 3.0f,
246  5.0f, 4.0f, 3.0f, 2.0f,
247  4.0f, 3.0f, 2.0f, 1.0f
248  };
249 
250  testParams.m_ExpectedOutputData =
251  {
252  1.0f, 3.0f,
253  3.0f, 5.0f,
254 
255  7.0f, 5.0f,
256  5.0f, 3.0f
257  };
258 
259  testParams.SetInOutQuantParams(3.141592f, 3);
260 
261  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
262 }

◆ ResizeNearestNeighborMagTest()

LayerTestResult<T, 4> ResizeNearestNeighborMagTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory,
const armnn::DataLayout  dataLayout,
float  inQuantScale,
int32_t  inQuantOffset,
float  outQuantScale,
int32_t  outQuantOffset 
)

Definition at line 503 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

512 {
513  ResizeTestParams testParams;
514  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
515  testParams.m_DataLayout = dataLayout;
516 
517  testParams.m_InputShape = { 1, 2, 3, 2 };
518  testParams.m_OutputShape = { 1, 2, 3, 5 };
519 
520  testParams.m_InputData =
521  {
522  0.183005f, 2.379065f,
523  1.054970f, 1.302565f,
524  2.400595f, 0.688960f,
525 
526  2.400595f, 0.688960f,
527  1.054970f, 1.302565f,
528  0.183005f, 2.379065f,
529  };
530 
531  testParams.m_ExpectedOutputData =
532  {
533  0.183005f, 0.183005f, 0.183005f, 2.379065f, 2.379065f,
534  1.054970f, 1.054970f, 1.054970f, 1.302565f, 1.302565f,
535  2.400595f, 2.400595f, 2.400595f, 0.688960f, 0.688960f,
536 
537  2.400595f, 2.400595f, 2.400595f, 0.688960f, 0.688960f,
538  1.054970f, 1.054970f, 1.054970f, 1.302565f, 1.302565f,
539  0.183005f, 0.183005f, 0.183005f, 2.379065f, 2.379065f
540  };
541 
542  testParams.SetInQuantParams(inQuantScale, inQuantOffset);
543  testParams.SetOutQuantParams(outQuantScale, outQuantOffset);
544 
545  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
546 }

◆ ResizeNearestNeighborMinTest()

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

Definition at line 464 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

469 {
470  ResizeTestParams testParams;
471  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
472  testParams.m_DataLayout = dataLayout;
473 
474  testParams.m_InputShape = { 1, 2, 3, 5 };
475  testParams.m_OutputShape = { 1, 2, 2, 3 };
476 
477  testParams.m_InputData =
478  {
479  1.5f, 3.0f, 4.5f, 6.0f, 7.5f,
480  9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
481  16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
482 
483  16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
484  9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
485  1.5f, 3.0f, 4.5f, 6.0f, 7.5f
486  };
487 
488  testParams.m_ExpectedOutputData =
489  {
490  1.5f, 3.0f, 6.0f,
491  9.0f, 10.5f, 13.5f,
492 
493  16.5f, 18.0f, 21.0f,
494  9.0f, 10.5f, 13.5f
495  };
496 
497  testParams.SetInOutQuantParams(1.5f, -1);
498 
499  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
500 }

◆ ResizeNearestNeighborNopTest()

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

Definition at line 349 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

354 {
355  ResizeTestParams testParams;
356  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
357  testParams.m_DataLayout = dataLayout;
358 
359  testParams.m_InputShape = { 1, 2, 4, 4 };
360  testParams.m_OutputShape = testParams.m_InputShape;
361 
362  testParams.m_InputData =
363  {
364  1.0f, 2.0f, 3.0f, 4.0f,
365  2.0f, 3.0f, 4.0f, 5.0f,
366  3.0f, 4.0f, 5.0f, 6.0f,
367  4.0f, 5.0f, 6.0f, 7.0f,
368 
369  1.0f, 2.0f, 3.0f, 4.0f,
370  2.0f, 3.0f, 4.0f, 5.0f,
371  3.0f, 4.0f, 5.0f, 6.0f,
372  4.0f, 5.0f, 6.0f, 7.0f
373  };
374 
375  testParams.m_ExpectedOutputData = testParams.m_InputData;
376 
377  testParams.SetInOutQuantParams(1.5f, 3);
378 
379  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
380 }

◆ ResizeNearestNeighborSqMinTest()

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

Definition at line 423 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

428 {
429  ResizeTestParams testParams;
430  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
431  testParams.m_DataLayout = dataLayout;
432 
433  testParams.m_InputShape = { 1, 2, 4, 4 };
434  testParams.m_OutputShape = { 1, 2, 2, 2 };
435 
436  testParams.m_InputData =
437  {
438  1.0f, 2.0f, 3.0f, 4.0f,
439  2.0f, 3.0f, 4.0f, 5.0f,
440  3.0f, 4.0f, 5.0f, 6.0f,
441  4.0f, 5.0f, 6.0f, 7.0f,
442 
443  7.0f, 6.0f, 5.0f, 4.0f,
444  6.0f, 5.0f, 4.0f, 3.0f,
445  5.0f, 4.0f, 3.0f, 2.0f,
446  4.0f, 3.0f, 2.0f, 1.0f
447  };
448 
449  testParams.m_ExpectedOutputData =
450  {
451  1.0f, 3.0f,
452  3.0f, 5.0f,
453 
454  7.0f, 5.0f,
455  5.0f, 3.0f
456  };
457 
458  testParams.SetInOutQuantParams(3.141592f, 3);
459 
460  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
461 }

◆ SimpleResizeBilinearTest()

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

Definition at line 184 of file ResizeTestImpl.cpp.

References armnn::Bilinear.

189 {
190  ResizeTestParams testParams;
191  testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
192  testParams.m_DataLayout = dataLayout;
193 
194  testParams.m_InputShape = { 1, 2, 2, 2 };
195  testParams.m_OutputShape = { 1, 2, 1, 1 };
196 
197  testParams.m_InputData =
198  {
199  1.0f, 255.0f,
200  200.0f, 250.0f,
201 
202  250.0f, 200.0f,
203  250.0f, 1.0f
204  };
205 
206  // The 'resize' operation projects the top-left corner of output texels into the input image,
207  // then figures out the interpolants and weights. Note this is different to projecting the centre of the
208  // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as
209  // its single element, the value that was at position (0,0) of the input matrix (rather than an average,
210  // which we would expect if projecting the centre).
211  testParams.m_ExpectedOutputData =
212  {
213  1.0f,
214 
215  250.0f
216  };
217 
218  testParams.SetInOutQuantParams(0.1567f, 1);
219 
220  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
221 }

◆ SimpleResizeNearestNeighborTest()

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

Definition at line 383 of file ResizeTestImpl.cpp.

References armnn::NearestNeighbor.

388 {
389  ResizeTestParams testParams;
390  testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
391  testParams.m_DataLayout = dataLayout;
392 
393  testParams.m_InputShape = { 1, 2, 2, 2 };
394  testParams.m_OutputShape = { 1, 2, 1, 1 };
395 
396  testParams.m_InputData =
397  {
398  1.0f, 255.0f,
399  200.0f, 250.0f,
400 
401  250.0f, 200.0f,
402  250.0f, 1.0f
403  };
404 
405  // The 'resize' operation projects the top-left corner of output texels into the input image,
406  // then figures out the interpolants and weights. Note this is different to projecting the centre of the
407  // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as
408  // its single element, the value that was at position (0,0) of the input matrix (rather than an average,
409  // which we would expect if projecting the centre).
410  testParams.m_ExpectedOutputData =
411  {
412  1.0f,
413 
414  250.0f
415  };
416 
417  testParams.SetInOutQuantParams(0.1567f, 1);
418 
419  return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, tensorHandleFactory, testParams);
420 }