aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-10-22 10:00:28 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-25 15:01:24 +0000
commit48623a0f6f4681ce0d9525b1587b7f96bfd58519 (patch)
treef5dbf25937e7b6641274e0953d09ca84acb51772 /src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp
parentc82c8732fb514b412012002bd951a84039eca696 (diff)
downloadarmnn-48623a0f6f4681ce0d9525b1587b7f96bfd58519.tar.gz
IVGCVSW-4018 Move QuantizeHelper.hpp to armnnUtils
* Moved QuntizeHelper.hpp to armnnUtils * Reordered parameters for QuantizedVector and added default values for qScale and qOffset to make life easier when using the function for non-quantized types such as Float16 Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: I28c263dfa425f1316feccb4116839a84f5d568e5
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp')
-rw-r--r--src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp77
1 files changed, 40 insertions, 37 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp
index c3cacd5810..3f22c31c7d 100644
--- a/src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/ConstantTestImpl.cpp
@@ -6,6 +6,7 @@
#include "ConstantTestImpl.hpp"
#include <Permute.hpp>
+#include <QuantizeHelper.hpp>
#include <ResolveType.hpp>
#include <armnn/ArmNN.hpp>
@@ -53,43 +54,45 @@ LayerTestResult<T, 4> ConstantTestImpl(
}
auto input = MakeTensor<T, 4>(inputTensorInfo, std::vector<T>(
- QuantizedVector<T>(qScale, qOffset, {
- // Batch 0, Channel 0
- 235.0f, 46.0f, 178.0f,
- 100.0f, 123.0f, 19.0f,
- 172.0f, 74.0f, 250.0f,
- 6.0f, 195.0f, 80.0f,
-
- // Batch 0, Channel 1
- 113.0f, 95.0f, 202.0f,
- 77.0f, 114.0f, 71.0f,
- 122.0f, 246.0f, 166.0f,
- 82.0f, 28.0f, 37.0f,
-
- // Batch 0, Channel 2
- 56.0f, 170.0f, 162.0f,
- 194.0f, 89.0f, 254.0f,
- 12.0f, 209.0f, 200.0f,
- 1.0f, 64.0f, 54.0f,
-
- // Batch 1, Channel 0
- 67.0f, 90.0f, 49.0f,
- 7.0f, 163.0f, 18.0f,
- 25.0f, 117.0f, 103.0f,
- 247.0f, 59.0f, 189.0f,
-
- // Batch 1, Channel 1
- 239.0f, 104.0f, 199.0f,
- 17.0f, 124.0f, 153.0f,
- 222.0f, 217.0f, 75.0f,
- 32.0f, 126.0f, 21.0f,
-
- // Batch 1, Channel 2
- 97.0f, 145.0f, 215.0f,
- 115.0f, 116.0f, 238.0f,
- 226.0f, 16.0f, 132.0f,
- 92.0f, 125.0f, 88.0f,
- })));
+ armnnUtils::QuantizedVector<T>(
+ {
+ // Batch 0, Channel 0
+ 235.0f, 46.0f, 178.0f,
+ 100.0f, 123.0f, 19.0f,
+ 172.0f, 74.0f, 250.0f,
+ 6.0f, 195.0f, 80.0f,
+
+ // Batch 0, Channel 1
+ 113.0f, 95.0f, 202.0f,
+ 77.0f, 114.0f, 71.0f,
+ 122.0f, 246.0f, 166.0f,
+ 82.0f, 28.0f, 37.0f,
+
+ // Batch 0, Channel 2
+ 56.0f, 170.0f, 162.0f,
+ 194.0f, 89.0f, 254.0f,
+ 12.0f, 209.0f, 200.0f,
+ 1.0f, 64.0f, 54.0f,
+
+ // Batch 1, Channel 0
+ 67.0f, 90.0f, 49.0f,
+ 7.0f, 163.0f, 18.0f,
+ 25.0f, 117.0f, 103.0f,
+ 247.0f, 59.0f, 189.0f,
+
+ // Batch 1, Channel 1
+ 239.0f, 104.0f, 199.0f,
+ 17.0f, 124.0f, 153.0f,
+ 222.0f, 217.0f, 75.0f,
+ 32.0f, 126.0f, 21.0f,
+
+ // Batch 1, Channel 2
+ 97.0f, 145.0f, 215.0f,
+ 115.0f, 116.0f, 238.0f,
+ 226.0f, 16.0f, 132.0f,
+ 92.0f, 125.0f, 88.0f,
+ },
+ qScale, qOffset)));
LayerTestResult<T, 4> result(outputTensorInfo);
result.outputExpected = input;