aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test
diff options
context:
space:
mode:
authorCian McGriskin <cian.mcgriskin@arm.com>2023-07-26 11:52:47 +0100
committerNikhil Raj <nikhil.raj@arm.com>2023-08-04 20:48:03 +0100
commit3b3dcbf0321fadcb2b7b5b550a4d03f510d7cb7b (patch)
tree9658a4d20fc73bfb8498aa8617202c49406f9eaa /src/backends/backendsCommon/test
parent88bef3acd73069df13256e818f32555b19e1a8b4 (diff)
downloadarmnn-3b3dcbf0321fadcb2b7b5b550a4d03f510d7cb7b.tar.gz
IVGCVSW-2291 TILE Operator CL Implementation
* Added Tile Operator Implementation to CL * Added calls to the existing UnitTests * Added Documentation Signed-off-by: Cian McGriskin <cian.mcgriskin@arm.com> Change-Id: If7d25c7aa669c24e7816e5d445c7a3b9ce6972d4
Diffstat (limited to 'src/backends/backendsCommon/test')
-rw-r--r--src/backends/backendsCommon/test/TileEndToEndTestImpl.hpp18
-rw-r--r--src/backends/backendsCommon/test/layerTests/TileTestImpl.cpp56
2 files changed, 43 insertions, 31 deletions
diff --git a/src/backends/backendsCommon/test/TileEndToEndTestImpl.hpp b/src/backends/backendsCommon/test/TileEndToEndTestImpl.hpp
index 4047e5ad8e..03b76849e1 100644
--- a/src/backends/backendsCommon/test/TileEndToEndTestImpl.hpp
+++ b/src/backends/backendsCommon/test/TileEndToEndTestImpl.hpp
@@ -32,25 +32,25 @@ void TileEndToEnd(const std::vector<BackendId>& backends)
int32_t qOffset = 0;
bool qConst = true;
- const TensorShape inputTensorShape = { 2, 3 };
- const TensorShape outputTensorShape = { 4, 6 };
+ const TensorShape inputTensorShape = { 6 };
+ const TensorShape outputTensorShape = { 30 };
TensorInfo inputInfo (inputTensorShape, ArmnnType, qScale, qOffset, qConst);
TensorInfo outputInfo (outputTensorShape, ArmnnType,qScale, qOffset);
std::vector<T> inputData = armnnUtils::QuantizedVector<T>({
- 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f
+ 65, 144, 91, 161, 56, 73
}, qScale, qOffset);
std::vector<T> expectedOutputData = armnnUtils::QuantizedVector<T>({
- 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f, 3.f, 4.f, 5.f,
- 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f, 3.f, 4.f, 5.f
+ 65, 144, 91, 161, 56, 73,
+ 65, 144, 91, 161, 56, 73,
+ 65, 144, 91, 161, 56, 73,
+ 65, 144, 91, 161, 56, 73,
+ 65, 144, 91, 161, 56, 73
}, qScale, qOffset);
- auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 2, 2 });
+ auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 5 });
INetworkPtr network = CreateTileNetwork(descriptor, inputInfo, outputInfo);
std::map<int, std::vector<T>> inputTensor = { { 0, inputData } };
diff --git a/src/backends/backendsCommon/test/layerTests/TileTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/TileTestImpl.cpp
index 0b13bba425..c61da26bb2 100644
--- a/src/backends/backendsCommon/test/layerTests/TileTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/TileTestImpl.cpp
@@ -110,13 +110,13 @@ LayerTestResult<T, 2> Tile2dTest(armnn::IWorkloadFactory& workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
const armnn::ITensorHandleFactory& tensorHandleFactory)
{
- auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 2, 2 });
+ auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 2, 5 });
float qScale = 1.0f;
int32_t qOffset = 0;
armnn::TensorShape inputShape = { 2, 3 };
- armnn::TensorShape outputShape = { 4, 6 };
+ armnn::TensorShape outputShape = { 4, 15 };
armnn::TensorInfo inputInfo(inputShape, ArmnnType);
armnn::TensorInfo outputInfo(outputShape, ArmnnType);
@@ -130,11 +130,11 @@ LayerTestResult<T, 2> Tile2dTest(armnn::IWorkloadFactory& workloadFactory,
std::vector<T> expectedOutput = armnnUtils::QuantizedVector<T>(
{
- 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f, 3.f, 4.f, 5.f,
+ 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
+ 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f,
- 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f, 3.f, 4.f, 5.f
+ 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
+ 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f, 3.f, 4.f, 5.f
}, qScale, qOffset);
return TileTestImpl<T, 2>(workloadFactory,
@@ -152,37 +152,49 @@ LayerTestResult<T, 3> Tile3dTest(armnn::IWorkloadFactory& workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
const armnn::ITensorHandleFactory& tensorHandleFactory)
{
- auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 1, 2, 1 });
+ auto descriptor = armnn::TileDescriptor(std::vector<uint32_t>{ 1, 5, 5 });
float qScale = 1.0f;
int32_t qOffset = 0;
- armnn::TensorShape inputShape = { 2, 2, 3 };
- armnn::TensorShape outputShape = { 2, 4, 3 };
+ armnn::TensorShape inputShape = { 2, 2, 2 };
+ armnn::TensorShape outputShape = { 2, 10, 10 };
armnn::TensorInfo inputInfo(inputShape, ArmnnType);
armnn::TensorInfo outputInfo(outputShape, ArmnnType);
std::vector<T> input = armnnUtils::QuantizedVector<T>(
{
- 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f,
+ 1.1f, 2.12f,
+ 3.3f, 4.12234f,
- 6.f, 7.f, 8.f,
- 9.f, 10.f, 11.f
+ 1.1f, 2.12f,
+ 3.3f, 4.12234f,
}, qScale, qOffset);
std::vector<T> expectedOutput = armnnUtils::QuantizedVector<T>(
{
- 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f,
- 0.f, 1.f, 2.f,
- 3.f, 4.f, 5.f,
-
- 6.f, 7.f, 8.f,
- 9.f, 10.f, 11.f,
- 6.f, 7.f, 8.f,
- 9.f, 10.f, 11.f
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f,
+ 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f, 1.1f, 2.12f,
+ 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f, 3.3f, 4.12234f
}, qScale, qOffset);
return TileTestImpl<T, 3>(workloadFactory,