aboutsummaryrefslogtreecommitdiff
path: root/src/armnnDeserializer
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2020-06-29 16:27:03 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2020-07-01 08:26:47 +0000
commit526647333571169076f5e72c9fb18c71025bf7c0 (patch)
tree6dc559a7b0fae3705172b09a88fa552926652040 /src/armnnDeserializer
parentcbd2c230b7ce5f26e2ccccf36b7ad450f6e1ad09 (diff)
downloadarmnn-526647333571169076f5e72c9fb18c71025bf7c0.tar.gz
IVGCVSW-4903 Connect axis parameter in Gather from android to ACL.
!android-nn-driver:3302 Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Ifbc49acb5272f8a36719bb68676e44817190537d
Diffstat (limited to 'src/armnnDeserializer')
-rw-r--r--src/armnnDeserializer/Deserializer.cpp5
-rw-r--r--src/armnnDeserializer/test/DeserializeGather.cpp18
2 files changed, 15 insertions, 8 deletions
diff --git a/src/armnnDeserializer/Deserializer.cpp b/src/armnnDeserializer/Deserializer.cpp
index f59c757f4b..31fae2af86 100644
--- a/src/armnnDeserializer/Deserializer.cpp
+++ b/src/armnnDeserializer/Deserializer.cpp
@@ -2427,8 +2427,11 @@ void Deserializer::ParseGather(GraphPtr graph, unsigned int layerIndex)
Deserializer::TensorRawPtrVector outputs = GetOutputs(graph, layerIndex);
CHECK_VALID_SIZE(outputs.size(), 1);
+ armnn::GatherDescriptor descriptor;
+ descriptor.m_Axis = graph->layers()->Get(layerIndex)->layer_as_GatherLayer()->descriptor()->axis();
+
auto layerName = GetLayerName(graph, layerIndex);
- IConnectableLayer* layer = m_Network->AddGatherLayer(layerName.c_str());
+ IConnectableLayer* layer = m_Network->AddGatherLayer(descriptor, layerName.c_str());
armnn::TensorInfo outputTensorInfo = ToTensorInfo(outputs[0]);
layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
diff --git a/src/armnnDeserializer/test/DeserializeGather.cpp b/src/armnnDeserializer/test/DeserializeGather.cpp
index 3fdcf51aed..0f75db4abb 100644
--- a/src/armnnDeserializer/test/DeserializeGather.cpp
+++ b/src/armnnDeserializer/test/DeserializeGather.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017 Arm Ltd. All rights reserved.
+// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -14,10 +14,11 @@ BOOST_AUTO_TEST_SUITE(Deserializer)
struct GatherFixture : public ParserFlatbuffersSerializeFixture
{
- explicit GatherFixture(const std::string &inputShape,
- const std::string &indicesShape,
- const std::string &input1Content,
- const std::string &outputShape,
+ explicit GatherFixture(const std::string& inputShape,
+ const std::string& indicesShape,
+ const std::string& input1Content,
+ const std::string& outputShape,
+ const std::string& axis,
const std::string dataType,
const std::string constDataType)
{
@@ -94,7 +95,10 @@ struct GatherFixture : public ParserFlatbuffersSerializeFixture
dimensions: )" + outputShape + R"(,
dataType: )" + dataType + R"(
- }}]}
+ }}]},
+ descriptor: {
+ axis: )" + axis + R"(
+ }
}},
{
layer_type: "OutputLayer",
@@ -127,7 +131,7 @@ struct GatherFixture : public ParserFlatbuffersSerializeFixture
struct SimpleGatherFixtureFloat32 : GatherFixture
{
SimpleGatherFixtureFloat32() : GatherFixture("[ 3, 2, 3 ]", "[ 2, 3 ]", "[1, 2, 1, 2, 1, 0]",
- "[ 2, 3, 2, 3 ]", "Float32", "IntData") {}
+ "[ 2, 3, 2, 3 ]", "0", "Float32", "IntData") {}
};
BOOST_FIXTURE_TEST_CASE(GatherFloat32, SimpleGatherFixtureFloat32)