2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "ResizeTestImpl.hpp"
8 #include <QuantizeHelper.hpp>
10 #include <armnn/ArmNN.hpp>
12 #include <armnnUtils/TensorUtils.hpp>
13 #include <armnnUtils/DataLayoutIndexed.hpp>
14 #include <armnnUtils/Permute.hpp>
16 #include <backendsCommon/test/DataLayoutUtils.hpp>
17 #include <backendsCommon/test/TensorCopyUtils.hpp>
18 #include <backendsCommon/test/WorkloadTestUtils.hpp>
20 #include <test/TensorHelpers.hpp>
25 struct ResizeTestParams
28 : m_ResizeMethod(armnn::ResizeMethod::Bilinear)
29 , m_DataLayout(armnn::DataLayout::NCHW)
30 , m_InQuantScale(1.0f)
32 , m_OutQuantScale(1.0f)
33 , m_OutQuantOffset(0) {}
35 armnn::ResizeMethod m_ResizeMethod;
36 armnn::DataLayout m_DataLayout;
38 armnn::TensorShape m_InputShape;
39 armnn::TensorShape m_OutputShape;
41 std::vector<float> m_InputData;
42 std::vector<float> m_ExpectedOutputData;
45 int32_t m_InQuantOffset;
47 float m_OutQuantScale;
48 int32_t m_OutQuantOffset;
50 void SetInQuantParams(float quantScale, int32_t quantOffset)
52 m_InQuantScale = quantScale;
53 m_InQuantOffset = quantOffset;
56 void SetOutQuantParams(float quantScale, int32_t quantOffset)
58 m_OutQuantScale = quantScale;
59 m_OutQuantOffset = quantOffset;
62 void SetInOutQuantParams(float quantScale, int32_t quantOffset)
64 SetInQuantParams(quantScale, quantOffset);
65 SetOutQuantParams(quantScale, quantOffset);
69 template<size_t NumDims,
70 armnn::DataType ArmnnType,
71 typename T = armnn::ResolveType<ArmnnType>>
72 LayerTestResult<T, NumDims> ResizeTestImpl(
73 armnn::IWorkloadFactory& workloadFactory,
74 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
75 const ResizeTestParams& params)
77 boost::ignore_unused(memoryManager);
78 armnn::TensorInfo inputInfo(params.m_InputShape, ArmnnType);
79 armnn::TensorInfo outputInfo(params.m_OutputShape, ArmnnType);
81 if (armnn::IsQuantizedType<T>())
83 inputInfo.SetQuantizationScale(params.m_InQuantScale);
84 inputInfo.SetQuantizationOffset(params.m_InQuantOffset);
86 outputInfo.SetQuantizationScale(params.m_OutQuantScale);
87 outputInfo.SetQuantizationOffset(params.m_OutQuantOffset);
90 std::vector<T> inputData =
91 armnnUtils::QuantizedVector<T>(params.m_InputData, params.m_InQuantScale, params.m_InQuantOffset);
93 std::vector<T> expectedOutputData =
94 armnnUtils::QuantizedVector<T>(params.m_ExpectedOutputData,
95 params.m_OutQuantScale,
96 params.m_OutQuantOffset);
98 if (params.m_DataLayout == armnn::DataLayout::NHWC)
100 PermuteTensorNchwToNhwc(inputInfo, inputData);
101 PermuteTensorNchwToNhwc(outputInfo, expectedOutputData);
104 auto input = MakeTensor<T, NumDims>(inputInfo, inputData);
106 LayerTestResult<T, NumDims> result(outputInfo);
107 result.outputExpected = MakeTensor<T, NumDims>(outputInfo, expectedOutputData);
109 std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputInfo);
110 std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputInfo);
112 armnn::ResizeQueueDescriptor descriptor;
113 descriptor.m_Parameters.m_Method = params.m_ResizeMethod;
114 descriptor.m_Parameters.m_DataLayout = params.m_DataLayout;
116 armnnUtils::DataLayoutIndexed dataLayoutIndexed(params.m_DataLayout);
117 descriptor.m_Parameters.m_TargetWidth = params.m_OutputShape[dataLayoutIndexed.GetWidthIndex()];
118 descriptor.m_Parameters.m_TargetHeight = params.m_OutputShape[dataLayoutIndexed.GetHeightIndex()];
120 armnn::WorkloadInfo info;
121 AddInputToWorkload(descriptor, info, inputInfo, inputHandle.get());
122 AddOutputToWorkload(descriptor, info, outputInfo, outputHandle.get());
124 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info);
126 inputHandle->Allocate();
127 outputHandle->Allocate();
128 CopyDataToITensorHandle(inputHandle.get(), input.origin());
130 workload->PostAllocationConfigure();
133 CopyDataFromITensorHandle(result.output.origin(), outputHandle.get());
137 } // anonymous namespace
143 template<armnn::DataType ArmnnType, typename T>
144 LayerTestResult<T, 4> ResizeBilinearNopTest(
145 armnn::IWorkloadFactory& workloadFactory,
146 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
147 const armnn::DataLayout dataLayout)
149 ResizeTestParams testParams;
150 testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
151 testParams.m_DataLayout = dataLayout;
153 testParams.m_InputShape = { 1, 2, 4, 4 };
154 testParams.m_OutputShape = testParams.m_InputShape;
156 testParams.m_InputData =
158 1.0f, 2.0f, 3.0f, 4.0f,
159 2.0f, 3.0f, 4.0f, 5.0f,
160 3.0f, 4.0f, 5.0f, 6.0f,
161 4.0f, 5.0f, 6.0f, 7.0f,
163 1.0f, 2.0f, 3.0f, 4.0f,
164 2.0f, 3.0f, 4.0f, 5.0f,
165 3.0f, 4.0f, 5.0f, 6.0f,
166 4.0f, 5.0f, 6.0f, 7.0f
169 testParams.m_ExpectedOutputData = testParams.m_InputData;
171 testParams.SetInOutQuantParams(1.5f, 3);
173 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
176 template<armnn::DataType ArmnnType, typename T>
177 LayerTestResult<T, 4> SimpleResizeBilinearTest(
178 armnn::IWorkloadFactory& workloadFactory,
179 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
180 const armnn::DataLayout dataLayout)
182 ResizeTestParams testParams;
183 testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
184 testParams.m_DataLayout = dataLayout;
186 testParams.m_InputShape = { 1, 2, 2, 2 };
187 testParams.m_OutputShape = { 1, 2, 1, 1 };
189 testParams.m_InputData =
198 // The 'resize' operation projects the top-left corner of output texels into the input image,
199 // then figures out the interpolants and weights. Note this is different to projecting the centre of the
200 // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as
201 // its single element, the value that was at position (0,0) of the input matrix (rather than an average,
202 // which we would expect if projecting the centre).
203 testParams.m_ExpectedOutputData =
210 testParams.SetInOutQuantParams(0.1567f, 1);
212 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
215 template<armnn::DataType ArmnnType, typename T>
216 LayerTestResult<T, 4> ResizeBilinearSqMinTest(
217 armnn::IWorkloadFactory& workloadFactory,
218 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
219 const armnn::DataLayout dataLayout)
221 ResizeTestParams testParams;
222 testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
223 testParams.m_DataLayout = dataLayout;
225 testParams.m_InputShape = { 1, 2, 4, 4 };
226 testParams.m_OutputShape = { 1, 2, 2, 2 };
228 testParams.m_InputData =
230 1.0f, 2.0f, 3.0f, 4.0f,
231 2.0f, 3.0f, 4.0f, 5.0f,
232 3.0f, 4.0f, 5.0f, 6.0f,
233 4.0f, 5.0f, 6.0f, 7.0f,
235 7.0f, 6.0f, 5.0f, 4.0f,
236 6.0f, 5.0f, 4.0f, 3.0f,
237 5.0f, 4.0f, 3.0f, 2.0f,
238 4.0f, 3.0f, 2.0f, 1.0f
241 testParams.m_ExpectedOutputData =
250 testParams.SetInOutQuantParams(3.141592f, 3);
252 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
255 template<armnn::DataType ArmnnType, typename T>
256 LayerTestResult<T, 4> ResizeBilinearMinTest(
257 armnn::IWorkloadFactory& workloadFactory,
258 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
259 const armnn::DataLayout dataLayout)
261 ResizeTestParams testParams;
262 testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
263 testParams.m_DataLayout = dataLayout;
265 testParams.m_InputShape = { 1, 2, 3, 5 };
266 testParams.m_OutputShape = { 1, 2, 2, 3 };
268 testParams.m_InputData =
270 1.5f, 3.0f, 4.5f, 6.0f, 7.5f,
271 9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
272 16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
274 16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
275 9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
276 1.5f, 3.0f, 4.5f, 6.0f, 7.5f
279 testParams.m_ExpectedOutputData =
282 12.75f, 15.25f, 17.75f,
284 16.50f, 19.00f, 21.50f,
288 testParams.SetInOutQuantParams(1.5f, -1);
290 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
293 template<armnn::DataType ArmnnType, typename T>
294 LayerTestResult<T, 4> ResizeBilinearMagTest(
295 armnn::IWorkloadFactory& workloadFactory,
296 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
297 const armnn::DataLayout dataLayout)
299 ResizeTestParams testParams;
300 testParams.m_ResizeMethod = armnn::ResizeMethod::Bilinear;
301 testParams.m_DataLayout = dataLayout;
303 testParams.m_InputShape = { 1, 2, 3, 2 };
304 testParams.m_OutputShape = { 1, 2, 3, 5 };
306 testParams.m_InputData =
317 testParams.m_ExpectedOutputData =
319 1.0f, 1.4f, 1.8f, 2.0f, 2.0f,
320 13.0f, 16.2f, 19.4f, 21.0f, 21.0f,
321 144.0f, 179.6f, 215.2f, 233.0f, 233.0f,
323 233.0f, 197.4f, 161.8f, 144.0f, 144.0f,
324 21.0f, 17.8f, 14.6f, 13.0f, 13.0f,
325 2.0f, 1.6f, 1.2f, 1.0f, 1.0f
328 testParams.SetInQuantParams(1.0f, 0);
330 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
337 template<armnn::DataType ArmnnType, typename T>
338 LayerTestResult<T, 4> ResizeNearestNeighborNopTest(
339 armnn::IWorkloadFactory& workloadFactory,
340 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
341 const armnn::DataLayout dataLayout)
343 ResizeTestParams testParams;
344 testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
345 testParams.m_DataLayout = dataLayout;
347 testParams.m_InputShape = { 1, 2, 4, 4 };
348 testParams.m_OutputShape = testParams.m_InputShape;
350 testParams.m_InputData =
352 1.0f, 2.0f, 3.0f, 4.0f,
353 2.0f, 3.0f, 4.0f, 5.0f,
354 3.0f, 4.0f, 5.0f, 6.0f,
355 4.0f, 5.0f, 6.0f, 7.0f,
357 1.0f, 2.0f, 3.0f, 4.0f,
358 2.0f, 3.0f, 4.0f, 5.0f,
359 3.0f, 4.0f, 5.0f, 6.0f,
360 4.0f, 5.0f, 6.0f, 7.0f
363 testParams.m_ExpectedOutputData = testParams.m_InputData;
365 testParams.SetInOutQuantParams(1.5f, 3);
367 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
370 template<armnn::DataType ArmnnType, typename T>
371 LayerTestResult<T, 4> SimpleResizeNearestNeighborTest(
372 armnn::IWorkloadFactory& workloadFactory,
373 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
374 const armnn::DataLayout dataLayout)
376 ResizeTestParams testParams;
377 testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
378 testParams.m_DataLayout = dataLayout;
380 testParams.m_InputShape = { 1, 2, 2, 2 };
381 testParams.m_OutputShape = { 1, 2, 1, 1 };
383 testParams.m_InputData =
392 // The 'resize' operation projects the top-left corner of output texels into the input image,
393 // then figures out the interpolants and weights. Note this is different to projecting the centre of the
394 // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as
395 // its single element, the value that was at position (0,0) of the input matrix (rather than an average,
396 // which we would expect if projecting the centre).
397 testParams.m_ExpectedOutputData =
404 testParams.SetInOutQuantParams(0.1567f, 1);
406 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
409 template<armnn::DataType ArmnnType, typename T>
410 LayerTestResult<T, 4> ResizeNearestNeighborSqMinTest(
411 armnn::IWorkloadFactory& workloadFactory,
412 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
413 const armnn::DataLayout dataLayout)
415 ResizeTestParams testParams;
416 testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
417 testParams.m_DataLayout = dataLayout;
419 testParams.m_InputShape = { 1, 2, 4, 4 };
420 testParams.m_OutputShape = { 1, 2, 2, 2 };
422 testParams.m_InputData =
424 1.0f, 2.0f, 3.0f, 4.0f,
425 2.0f, 3.0f, 4.0f, 5.0f,
426 3.0f, 4.0f, 5.0f, 6.0f,
427 4.0f, 5.0f, 6.0f, 7.0f,
429 7.0f, 6.0f, 5.0f, 4.0f,
430 6.0f, 5.0f, 4.0f, 3.0f,
431 5.0f, 4.0f, 3.0f, 2.0f,
432 4.0f, 3.0f, 2.0f, 1.0f
435 testParams.m_ExpectedOutputData =
444 testParams.SetInOutQuantParams(3.141592f, 3);
446 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
449 template<armnn::DataType ArmnnType, typename T>
450 LayerTestResult<T, 4> ResizeNearestNeighborMinTest(
451 armnn::IWorkloadFactory& workloadFactory,
452 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
453 const armnn::DataLayout dataLayout)
455 ResizeTestParams testParams;
456 testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
457 testParams.m_DataLayout = dataLayout;
459 testParams.m_InputShape = { 1, 2, 3, 5 };
460 testParams.m_OutputShape = { 1, 2, 2, 3 };
462 testParams.m_InputData =
464 1.5f, 3.0f, 4.5f, 6.0f, 7.5f,
465 9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
466 16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
468 16.5f, 18.0f, 19.5f, 21.0f, 22.5f,
469 9.0f, 10.5f, 12.0f, 13.5f, 15.0f,
470 1.5f, 3.0f, 4.5f, 6.0f, 7.5f
473 testParams.m_ExpectedOutputData =
482 testParams.SetInOutQuantParams(1.5f, -1);
484 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
487 template<armnn::DataType ArmnnType, typename T>
488 LayerTestResult<T, 4> ResizeNearestNeighborMagTest(
489 armnn::IWorkloadFactory& workloadFactory,
490 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
491 const armnn::DataLayout dataLayout,
493 int32_t inQuantOffset,
495 int32_t outQuantOffset)
497 ResizeTestParams testParams;
498 testParams.m_ResizeMethod = armnn::ResizeMethod::NearestNeighbor;
499 testParams.m_DataLayout = dataLayout;
501 testParams.m_InputShape = { 1, 2, 3, 2 };
502 testParams.m_OutputShape = { 1, 2, 3, 5 };
504 testParams.m_InputData =
506 0.183005f, 2.379065f,
507 1.054970f, 1.302565f,
508 2.400595f, 0.688960f,
510 2.400595f, 0.688960f,
511 1.054970f, 1.302565f,
512 0.183005f, 2.379065f,
515 testParams.m_ExpectedOutputData =
517 0.183005f, 0.183005f, 0.183005f, 2.379065f, 2.379065f,
518 1.054970f, 1.054970f, 1.054970f, 1.302565f, 1.302565f,
519 2.400595f, 2.400595f, 2.400595f, 0.688960f, 0.688960f,
521 2.400595f, 2.400595f, 2.400595f, 0.688960f, 0.688960f,
522 1.054970f, 1.054970f, 1.054970f, 1.302565f, 1.302565f,
523 0.183005f, 0.183005f, 0.183005f, 2.379065f, 2.379065f
526 testParams.SetInQuantParams(inQuantScale, inQuantOffset);
527 testParams.SetOutQuantParams(outQuantScale, outQuantOffset);
529 return ResizeTestImpl<4, ArmnnType>(workloadFactory, memoryManager, testParams);
533 // Explicit template instantiations
537 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
538 ResizeBilinearNopTest<armnn::DataType::Float32>(
539 armnn::IWorkloadFactory& workloadFactory,
540 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
541 const armnn::DataLayout dataLayout);
543 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
544 SimpleResizeBilinearTest<armnn::DataType::Float32>(
545 armnn::IWorkloadFactory& workloadFactory,
546 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
547 const armnn::DataLayout dataLayout);
549 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
550 ResizeBilinearSqMinTest<armnn::DataType::Float32>(
551 armnn::IWorkloadFactory& workloadFactory,
552 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
553 const armnn::DataLayout dataLayout);
555 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
556 ResizeBilinearMinTest<armnn::DataType::Float32>(
557 armnn::IWorkloadFactory& workloadFactory,
558 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
559 const armnn::DataLayout dataLayout);
561 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
562 ResizeBilinearMagTest<armnn::DataType::Float32>(
563 armnn::IWorkloadFactory& workloadFactory,
564 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
565 const armnn::DataLayout dataLayout);
567 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
568 ResizeNearestNeighborNopTest<armnn::DataType::Float32>(
569 armnn::IWorkloadFactory& workloadFactory,
570 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
571 const armnn::DataLayout dataLayout);
573 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
574 SimpleResizeNearestNeighborTest<armnn::DataType::Float32>(
575 armnn::IWorkloadFactory& workloadFactory,
576 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
577 const armnn::DataLayout dataLayout);
579 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
580 ResizeNearestNeighborSqMinTest<armnn::DataType::Float32>(
581 armnn::IWorkloadFactory& workloadFactory,
582 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
583 const armnn::DataLayout dataLayout);
585 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
586 ResizeNearestNeighborMinTest<armnn::DataType::Float32>(
587 armnn::IWorkloadFactory& workloadFactory,
588 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
589 const armnn::DataLayout dataLayout);
591 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
592 ResizeNearestNeighborMagTest<armnn::DataType::Float32>(
593 armnn::IWorkloadFactory& workloadFactory,
594 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
595 const armnn::DataLayout dataLayout,
597 int32_t inQuantOffset,
599 int32_t outQuantOffset);
602 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
603 ResizeBilinearNopTest<armnn::DataType::Float16>(
604 armnn::IWorkloadFactory& workloadFactory,
605 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
606 const armnn::DataLayout dataLayout);
608 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
609 SimpleResizeBilinearTest<armnn::DataType::Float16>(
610 armnn::IWorkloadFactory& workloadFactory,
611 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
612 const armnn::DataLayout dataLayout);
614 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
615 ResizeBilinearSqMinTest<armnn::DataType::Float16>(
616 armnn::IWorkloadFactory& workloadFactory,
617 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
618 const armnn::DataLayout dataLayout);
620 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
621 ResizeBilinearMinTest<armnn::DataType::Float16>(
622 armnn::IWorkloadFactory& workloadFactory,
623 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
624 const armnn::DataLayout dataLayout);
626 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
627 ResizeBilinearMagTest<armnn::DataType::Float16>(
628 armnn::IWorkloadFactory& workloadFactory,
629 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
630 const armnn::DataLayout dataLayout);
632 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
633 ResizeNearestNeighborNopTest<armnn::DataType::Float16>(
634 armnn::IWorkloadFactory& workloadFactory,
635 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
636 const armnn::DataLayout dataLayout);
638 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
639 SimpleResizeNearestNeighborTest<armnn::DataType::Float16>(
640 armnn::IWorkloadFactory& workloadFactory,
641 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
642 const armnn::DataLayout dataLayout);
644 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
645 ResizeNearestNeighborSqMinTest<armnn::DataType::Float16>(
646 armnn::IWorkloadFactory& workloadFactory,
647 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
648 const armnn::DataLayout dataLayout);
650 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
651 ResizeNearestNeighborMinTest<armnn::DataType::Float16>(
652 armnn::IWorkloadFactory& workloadFactory,
653 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
654 const armnn::DataLayout dataLayout);
656 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 4>
657 ResizeNearestNeighborMagTest<armnn::DataType::Float16>(
658 armnn::IWorkloadFactory& workloadFactory,
659 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
660 const armnn::DataLayout dataLayout,
662 int32_t inQuantOffset,
664 int32_t outQuantOffset);
667 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
668 ResizeBilinearNopTest<armnn::DataType::QAsymmU8>(
669 armnn::IWorkloadFactory& workloadFactory,
670 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
671 const armnn::DataLayout dataLayout);
673 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
674 SimpleResizeBilinearTest<armnn::DataType::QAsymmU8>(
675 armnn::IWorkloadFactory& workloadFactory,
676 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
677 const armnn::DataLayout dataLayout);
679 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
680 ResizeBilinearSqMinTest<armnn::DataType::QAsymmU8>(
681 armnn::IWorkloadFactory& workloadFactory,
682 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
683 const armnn::DataLayout dataLayout);
685 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
686 ResizeBilinearMinTest<armnn::DataType::QAsymmU8>(
687 armnn::IWorkloadFactory& workloadFactory,
688 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
689 const armnn::DataLayout dataLayout);
691 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
692 ResizeBilinearMagTest<armnn::DataType::QAsymmU8>(
693 armnn::IWorkloadFactory& workloadFactory,
694 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
695 const armnn::DataLayout dataLayout);
697 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
698 ResizeNearestNeighborNopTest<armnn::DataType::QAsymmU8>(
699 armnn::IWorkloadFactory& workloadFactory,
700 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
701 const armnn::DataLayout dataLayout);
703 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
704 SimpleResizeNearestNeighborTest<armnn::DataType::QAsymmU8>(
705 armnn::IWorkloadFactory& workloadFactory,
706 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
707 const armnn::DataLayout dataLayout);
709 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
710 ResizeNearestNeighborSqMinTest<armnn::DataType::QAsymmU8>(
711 armnn::IWorkloadFactory& workloadFactory,
712 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
713 const armnn::DataLayout dataLayout);
715 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
716 ResizeNearestNeighborMinTest<armnn::DataType::QAsymmU8>(
717 armnn::IWorkloadFactory& workloadFactory,
718 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
719 const armnn::DataLayout dataLayout);
721 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
722 ResizeNearestNeighborMagTest<armnn::DataType::QAsymmU8>(
723 armnn::IWorkloadFactory& workloadFactory,
724 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
725 const armnn::DataLayout dataLayout,
727 int32_t inQuantOffset,
729 int32_t outQuantOffset);
732 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
733 ResizeBilinearNopTest<armnn::DataType::QSymmS16>(
734 armnn::IWorkloadFactory& workloadFactory,
735 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
736 const armnn::DataLayout dataLayout);
738 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
739 SimpleResizeBilinearTest<armnn::DataType::QSymmS16>(
740 armnn::IWorkloadFactory& workloadFactory,
741 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
742 const armnn::DataLayout dataLayout);
744 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
745 ResizeBilinearSqMinTest<armnn::DataType::QSymmS16>(
746 armnn::IWorkloadFactory& workloadFactory,
747 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
748 const armnn::DataLayout dataLayout);
750 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
751 ResizeBilinearMinTest<armnn::DataType::QSymmS16>(
752 armnn::IWorkloadFactory& workloadFactory,
753 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
754 const armnn::DataLayout dataLayout);
756 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
757 ResizeBilinearMagTest<armnn::DataType::QSymmS16>(
758 armnn::IWorkloadFactory& workloadFactory,
759 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
760 const armnn::DataLayout dataLayout);
762 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
763 ResizeNearestNeighborNopTest<armnn::DataType::QSymmS16>(
764 armnn::IWorkloadFactory& workloadFactory,
765 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
766 const armnn::DataLayout dataLayout);
768 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
769 SimpleResizeNearestNeighborTest<armnn::DataType::QSymmS16>(
770 armnn::IWorkloadFactory& workloadFactory,
771 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
772 const armnn::DataLayout dataLayout);
774 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
775 ResizeNearestNeighborSqMinTest<armnn::DataType::QSymmS16>(
776 armnn::IWorkloadFactory& workloadFactory,
777 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
778 const armnn::DataLayout dataLayout);
780 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
781 ResizeNearestNeighborMinTest<armnn::DataType::QSymmS16>(
782 armnn::IWorkloadFactory& workloadFactory,
783 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
784 const armnn::DataLayout dataLayout);
786 template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 4>
787 ResizeNearestNeighborMagTest<armnn::DataType::QSymmS16>(
788 armnn::IWorkloadFactory& workloadFactory,
789 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
790 const armnn::DataLayout dataLayout,
792 int32_t inQuantOffset,
794 int32_t outQuantOffset);