diff options
author | Matthew Jackson <matthew.jackson@arm.com> | 2019-08-20 17:18:33 +0100 |
---|---|---|
committer | Áron Virginás-Tar <aron.virginas-tar@arm.com> | 2019-08-21 12:09:47 +0000 |
commit | ccb25ea483747d4f7f319e0d3f1c9c6507931011 (patch) | |
tree | ed49ee9057c35d0388e21945a3d94948f53d6142 /src/armnnTfLiteParser/TfLiteParser.cpp | |
parent | 7599aa47f29531ebcbb3badea73ec181616bb29b (diff) | |
download | armnn-ccb25ea483747d4f7f319e0d3f1c9c6507931011.tar.gz |
IVGCVSW-3650 Fix Transpose Convolution inputs in TfLite parser
* Reordered and edited inputs in ParseTransposeConv method
* Updated test cases to reflect changes
Signed-off-by: Matthew Jackson <matthew.jackson@arm.com>
Change-Id: Icd090cf6ab340eed4f098ef8641daf7c6e0d0949
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.cpp')
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp index 0e11a5c3e1..d1cef31446 100644 --- a/src/armnnTfLiteParser/TfLiteParser.cpp +++ b/src/armnnTfLiteParser/TfLiteParser.cpp @@ -879,12 +879,12 @@ void TfLiteParser::ParseTransposeConv(size_t subgraphIndex, size_t operatorIndex desc.m_DataLayout = armnn::DataLayout::NHWC; auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex); - CHECK_VALID_SIZE(inputs.size(), 2, 3); + CHECK_VALID_SIZE(inputs.size(), 3); auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex); CHECK_VALID_SIZE(outputs.size(), 1); - armnn::TensorInfo inputTensorInfo = ToTensorInfo(inputs[0]); + armnn::TensorInfo inputTensorInfo = ToTensorInfo(inputs[2]); armnn::TensorInfo filterTensorInfo = ToTensorInfo(inputs[1]); // TfLite uses NHWC tensors @@ -917,25 +917,10 @@ void TfLiteParser::ParseTransposeConv(size_t subgraphIndex, size_t operatorIndex armnn::IConnectableLayer* layer = nullptr; auto layerName = boost::str(boost::format("TransposeConv:%1%:%2%") % subgraphIndex % operatorIndex); - if (inputs.size() == 3) - { - desc.m_BiasEnabled = true; - armnn::TensorInfo biasTensorInfo = ToTensorInfo(inputs[2]); - auto biasTensorAndData = CreateConstTensor(inputs[2], - biasTensorInfo, - armnn::Optional<armnn::PermutationVector&>()); - layer = m_Network->AddTransposeConvolution2dLayer(desc, - filterTensorAndData.first, - Optional<ConstTensor>(biasTensorAndData.first), - layerName.c_str()); - } - else - { - layer = m_Network->AddTransposeConvolution2dLayer(desc, - filterTensorAndData.first, - EmptyOptional(), - layerName.c_str()); - } + layer = m_Network->AddTransposeConvolution2dLayer(desc, + filterTensorAndData.first, + EmptyOptional(), + layerName.c_str()); BOOST_ASSERT(layer != nullptr); @@ -944,7 +929,7 @@ void TfLiteParser::ParseTransposeConv(size_t subgraphIndex, size_t operatorIndex // only the tensors for the inputs are relevant, exclude the const (filter) tensor auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); - RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]}); + RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[2]}); auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); |