IVGCVSW-3247: Refactor reference Gather workload
* Refactored Gather reference workload to not use templates for different types
* Added quantization values in Gather unit tests for Quantized types
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Change-Id: Ibe5d655aa1c287824e45b83818c5862bda7f92b0
diff --git a/src/backends/backendsCommon/test/GatherTestImpl.hpp b/src/backends/backendsCommon/test/GatherTestImpl.hpp
index 16b266e..8fbfeea 100644
--- a/src/backends/backendsCommon/test/GatherTestImpl.hpp
+++ b/src/backends/backendsCommon/test/GatherTestImpl.hpp
@@ -63,6 +63,13 @@
armnn::TensorInfo indicesInfo({ 4 }, armnn::DataType::Signed32);
armnn::TensorInfo outputInfo({ 4 }, ArmnnType);
+ if (armnn::IsQuantizedType<T>())
+ {
+ paramsInfo.SetQuantizationScale(1.0f);
+ paramsInfo.SetQuantizationOffset(1);
+ outputInfo.SetQuantizationScale(1.0f);
+ outputInfo.SetQuantizationOffset(1);
+ }
const std::vector<T> params = std::vector<T>({ 1, 2, 3, 4, 5, 6, 7, 8 });
const std::vector<int32_t> indices = std::vector<int32_t>({ 0, 2, 1, 5 });
const std::vector<T> expectedOutput = std::vector<T>({ 1, 3, 2, 6 });
@@ -80,6 +87,14 @@
armnn::TensorInfo indicesInfo({ 3 }, armnn::DataType::Signed32);
armnn::TensorInfo outputInfo({ 3, 2 }, ArmnnType);
+ if (armnn::IsQuantizedType<T>())
+ {
+ paramsInfo.SetQuantizationScale(1.0f);
+ paramsInfo.SetQuantizationOffset(1);
+ outputInfo.SetQuantizationScale(1.0f);
+ outputInfo.SetQuantizationOffset(1);
+ }
+
const std::vector<T> params = std::vector<T>({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
const std::vector<int32_t> indices = std::vector<int32_t>({ 1, 3, 4 });
const std::vector<T> expectedOutput = std::vector<T>({ 3, 4, 7, 8, 9, 10 });
@@ -97,6 +112,14 @@
armnn::TensorInfo indicesInfo({ 2, 3 }, armnn::DataType::Signed32);
armnn::TensorInfo outputInfo({ 2, 3, 2, 3 }, ArmnnType);
+ if (armnn::IsQuantizedType<T>())
+ {
+ paramsInfo.SetQuantizationScale(1.0f);
+ paramsInfo.SetQuantizationOffset(1);
+ outputInfo.SetQuantizationScale(1.0f);
+ outputInfo.SetQuantizationOffset(1);
+ }
+
const std::vector<T> params = std::vector<T>({
1, 2, 3,
4, 5, 6,