aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test
diff options
context:
space:
mode:
authorEllen Norris-Thompson <ellen.norris-thompson@arm.com>2019-06-21 15:50:00 +0100
committerEllen Norris-Thompson <ellen.norris-thompson@arm.com>2019-06-24 11:14:48 +0100
commit6858d3fb714cc20d5fcfd814c35ed3a84dc82145 (patch)
treedb6a6651fff0dce4095be58bc155e63175abe33e /src/backends/backendsCommon/test
parent389aa70c8a24fa2faf33df5f8cd9a99b0fabe971 (diff)
downloadarmnn-6858d3fb714cc20d5fcfd814c35ed3a84dc82145.tar.gz
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
Diffstat (limited to 'src/backends/backendsCommon/test')
-rw-r--r--src/backends/backendsCommon/test/GatherTestImpl.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/backends/backendsCommon/test/GatherTestImpl.hpp b/src/backends/backendsCommon/test/GatherTestImpl.hpp
index 16b266ed29..8fbfeeae3d 100644
--- a/src/backends/backendsCommon/test/GatherTestImpl.hpp
+++ b/src/backends/backendsCommon/test/GatherTestImpl.hpp
@@ -63,6 +63,13 @@ LayerTestResult<T, 1> Gather1DParamsTestImpl(armnn::IWorkloadFactory& workloadFa
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 @@ LayerTestResult<T, 2> GatherMultiDimParamsTestImpl(
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 @@ LayerTestResult<T, 4> GatherMultiDimParamsMultiDimIndicesTestImpl(
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,