aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser/TfLiteParser.cpp
diff options
context:
space:
mode:
authorTracy Narine <tracy.narine@arm.com>2023-07-13 16:50:54 +0100
committerTracy Narine <tracy.narine@arm.com>2023-07-17 14:19:36 +0100
commitbb8d7591a35bd95480b39001f8b7e41a6671f3a6 (patch)
treeabf2871aa1bb86378f423df405164b0d4521db3f /src/armnnTfLiteParser/TfLiteParser.cpp
parent688268328c69e7d4181cdd31fe4717c80a6d1685 (diff)
downloadarmnn-bb8d7591a35bd95480b39001f8b7e41a6671f3a6.tar.gz
IVGCVSW-7879 Change REVERSE_V2 from LayerWithParameters with 1 input, to Layer with 2 inputs
* Changing ReverseV2 to use two inputs * This is required by the backends * The ReverseV2Descriptor was removed * Tests updated * Added a Run<> templatefor inputs with different data types Signed-off-by: Tracy Narine <tracy.narine@arm.com> Change-Id: I22f947de829b4b3da6bda3a74f4ffdef4052cc25
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.cpp')
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp
index 078786cb93..77ce565959 100644
--- a/src/armnnTfLiteParser/TfLiteParser.cpp
+++ b/src/armnnTfLiteParser/TfLiteParser.cpp
@@ -3294,46 +3294,13 @@ void TfLiteParserImpl::ParseReverseV2(size_t subgraphIndex, size_t operatorIndex
TensorInfo axisTensorInfo = ToTensorInfo(inputs[1]);
TensorInfo outputTensorInfo = ToTensorInfo(outputs[0]);
- std::vector<int32_t> axisTensorData(axisTensorInfo.GetNumElements());
-
- BufferRawPtr axisBufferPtr = GetBuffer(m_Model, inputs[1]->buffer);
- ::memcpy(axisTensorData.data(), axisBufferPtr->data.data(), axisTensorInfo.GetNumBytes());
-
- ReverseV2Descriptor descriptor(axisTensorData);
-
- auto inputRank = static_cast<int32_t>(inputTensorInfo.GetNumDimensions());
- std::vector<bool> dimFlag(inputRank, false);
-
- for (auto axis : axisTensorData)
- {
- if (axis < -inputRank || axis >= inputRank)
- {
- throw ParseException(
- fmt::format("Operation has invalid axis: {} It is out of bounds [ -{}, {} ) {}",
- axis,
- inputRank, inputRank,
- CHECK_LOCATION().AsString()));
- }
-
- auto posAxis = axis < 0 ? axis + inputRank : axis;
-
- if (dimFlag[posAxis])
- {
- throw ParseException(
- fmt::format("Operation has repeated axis: {} {}",
- axis,
- CHECK_LOCATION().AsString()));
- }
- dimFlag[posAxis] = true;
- }
-
- IConnectableLayer* layer = m_Network->AddReverseV2Layer(descriptor, layerName.c_str());
+ IConnectableLayer* layer = m_Network->AddReverseV2Layer(layerName.c_str());
ARMNN_ASSERT(layer != nullptr);
layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex));
- RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]});
+ RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]});
auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex));
RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]});