aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/LayerTests.cpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2019-05-22 17:21:49 +0100
committerRuomei Yan <ruomei.yan@arm.com>2019-05-23 09:23:19 +0000
commit9b3983299f882c8d84c5abd0d40ca75a801ea7f2 (patch)
tree40866201c7a65b5c4d10034b5f03a35070cc961f /src/backends/backendsCommon/test/LayerTests.cpp
parent31b2e134c392617de7a41c56d460ac494eab0140 (diff)
downloadarmnn-9b3983299f882c8d84c5abd0d40ca75a801ea7f2.tar.gz
IVGCVSW-3025: Refactor reference Convolution2d workload
* Refactored RefConvolution2dWorkload to support all DataTypes through Encoders and Decoders. * Added Convolute function to ConvImpl that uses Encoders and Decoders to support all DataTypes. * Deleted RefConvolution2dFloat32Workload and RefConvolution2dUint8Workload. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ic5ef0f499d08b948fa65fdee54b5f681fd0b1c05
Diffstat (limited to 'src/backends/backendsCommon/test/LayerTests.cpp')
-rw-r--r--src/backends/backendsCommon/test/LayerTests.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backends/backendsCommon/test/LayerTests.cpp b/src/backends/backendsCommon/test/LayerTests.cpp
index 5d059598a5..c94dc53291 100644
--- a/src/backends/backendsCommon/test/LayerTests.cpp
+++ b/src/backends/backendsCommon/test/LayerTests.cpp
@@ -79,12 +79,12 @@ static std::vector<float> Bias2({0, 2});
// Helper function that returns either Bias2 or an empty vector depending on whether bias is enabled.
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
-boost::multi_array<T, 1> GetBias2(bool biasEnabled, float qScale, int32_t qOffset)
+boost::multi_array<T, 1> GetBias2(bool biasEnabled, float qScale)
{
if(biasEnabled)
{
armnn::TensorInfo biasDesc({static_cast<unsigned int>(Bias2.size())}, ArmnnType);
- boost::multi_array<T, 1> bias = MakeTensor<T, 1>(biasDesc, QuantizedVector<T>(qScale, qOffset, Bias2));
+ boost::multi_array<T, 1> bias = MakeTensor<T, 1>(biasDesc, QuantizedVector<T>(qScale, 0.0f, Bias2));
return bias;
}
else
@@ -170,7 +170,7 @@ LayerTestResult<T, 4> SimpleConvolution2d3x5TestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset),
+ GetBias2<ArmnnBType>(biasEnabled, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -247,7 +247,7 @@ LayerTestResult<T, 4> SimpleConvolution2d3x3TestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset),
+ GetBias2<ArmnnBType>(biasEnabled, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -494,7 +494,7 @@ LayerTestResult<T, 4> Convolution2dAsymmetricPaddingLargerThanHalfKernelSizeTest
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(false, qScale, qOffset),
+ GetBias2<ArmnnBType>(false, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -552,7 +552,7 @@ LayerTestResult<T, 4> SimpleConvolution2dAsymmetricPaddingTestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(false, qScale, qOffset),
+ GetBias2<ArmnnBType>(false, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -627,7 +627,7 @@ LayerTestResult<T, 4> DepthwiseConvolution2dAsymmetricTestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset),
+ GetBias2<ArmnnBType>(biasEnabled, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -736,7 +736,7 @@ LayerTestResult<T, 4> DepthwiseConvolution2dNhwcTestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset),
+ GetBias2<ArmnnBType>(biasEnabled, qScale * qScale),
expectedOutput,
qScale,
qOffset,
@@ -802,7 +802,7 @@ LayerTestResult<T, 4> SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTestCommon(
memoryManager,
input,
kernel,
- GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset),
+ GetBias2<ArmnnBType>(biasEnabled, qScale * qScale),
expectedOutput,
qScale,
qOffset,