aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2021-04-26 23:53:31 +0100
committerKevin May <kevin.may@arm.com>2021-05-04 09:57:33 +0000
commitdf25859fe99ce721958d197534d6df11445b9d36 (patch)
tree6eb52b2e9a5b32397553cf99fdd4e2ce39908d51
parent73d3e2e1616ba5dcdb0a190afba2463742bd4fcc (diff)
downloadarmnn-df25859fe99ce721958d197534d6df11445b9d36.tar.gz
IVGCVSW-5940 Enabling NN Driver dumps results in a driver segfault
* Added checks to SerializerStrategy::CreateTensorInfo to handle situations where a shape has some unspecified dimensions Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Idc64bfdabd5677c73a5c64f0c8e80156f3aae8e2
-rw-r--r--src/armnnSerializer/Serializer.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/armnnSerializer/Serializer.cpp b/src/armnnSerializer/Serializer.cpp
index b742cd87d8..944797fda3 100644
--- a/src/armnnSerializer/Serializer.cpp
+++ b/src/armnnSerializer/Serializer.cpp
@@ -1674,17 +1674,21 @@ flatbuffers::Offset<TensorInfo> SerializerStrategy::CreateTensorInfo(const armn
{
// Get the dimensions
std::vector<unsigned int> shape;
- for(unsigned int dim = 0; dim < tensorInfo.GetShape().GetNumDimensions(); ++dim)
- {
- shape.push_back(tensorInfo.GetShape()[dim]);
- }
-
std::vector<bool> specificity;
// This assumes that the TensorShape constructors have ensured that the size of m_DimensionsSpecificity
// matches the size of dimensions.
for(unsigned int dim = 0; dim < tensorInfo.GetShape().GetNumDimensions(); ++dim)
{
specificity.push_back(tensorInfo.GetShape().GetDimensionSpecificity(dim));
+
+ if (tensorInfo.GetShape().GetDimensionSpecificity(dim))
+ {
+ shape.push_back(tensorInfo.GetShape()[dim]);
+ }
+ else
+ {
+ shape.push_back(0);
+ }
}
if (tensorInfo.HasPerAxisQuantization())