diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-09-20 16:40:09 +0100 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-09-20 16:05:10 +0000 |
commit | de33dda47d4afec985dc84ebf9a7a18a5a27659c (patch) | |
tree | 964ae59cec22eb14649cc537103a92af2f039d22 | |
parent | 80a9d88d6ea1788a627fab9c51c9c1968b8c8038 (diff) | |
download | armnn-de33dda47d4afec985dc84ebf9a7a18a5a27659c.tar.gz |
IVGCVSW-7040 TfLiteParser fails to prepare model due to unspecified size buffer data for Slice operator.
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: I86735faf8d57168a63ca6657f281ec03b90f7235
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp index 030420345e..a26f3e5f04 100644 --- a/src/armnnTfLiteParser/TfLiteParser.cpp +++ b/src/armnnTfLiteParser/TfLiteParser.cpp @@ -1841,8 +1841,14 @@ void TfLiteParserImpl::ParseSlice(size_t subgraphIndex, size_t operatorIndex) armnn::TensorInfo sizeTensorInfo = ToTensorInfo(inputs[2]); BufferRawPtr sizeBufferPtr = GetBuffer(m_Model, inputs[2]->buffer); - std::vector<int> signedSize(sizeTensorInfo.GetNumElements()); - ::memcpy(signedSize.data(), sizeBufferPtr->data.data(), sizeTensorInfo.GetNumBytes()); + std::vector<int> signedSize(sizeTensorInfo.GetNumElements(), 1); + + // if size buffer data is not specified, all contents of size vector remain as values of 1 + if (sizeBufferPtr->data.data()) + { + ::memcpy(signedSize.data(), sizeBufferPtr->data.data(), sizeTensorInfo.GetNumBytes()); + } + std::vector<unsigned int> size(sizeTensorInfo.GetNumElements()); TensorInfo inputTensorInfo = ToTensorInfo(inputs[0]); |