IVGCVSW-5648 Adding serializer support for m_DimensionsSpecificity
The field m_DimensionsSpecificity in TensorShape was not being serialized
and deserialized following implementation of type 1 dynamic tensors.
* Update schema.
* Add to Serializer and Deserializer.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I7ddbdaf54c8f4b988c6cb300f90ba848a94bdad0
diff --git a/src/armnnSerializer/Serializer.cpp b/src/armnnSerializer/Serializer.cpp
index bcdaa08..0586700 100644
--- a/src/armnnSerializer/Serializer.cpp
+++ b/src/armnnSerializer/Serializer.cpp
@@ -1668,6 +1668,14 @@
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.HasPerAxisQuantization())
{
// Create FlatBuffer TensorInfo
@@ -1680,7 +1688,8 @@
m_flatBufferBuilder.CreateVector(tensorInfo.GetQuantizationScales()),
tensorInfo.GetQuantizationDim().value(),
static_cast<unsigned int>
- (tensorInfo.GetShape().GetDimensionality()));
+ (tensorInfo.GetShape().GetDimensionality()),
+ m_flatBufferBuilder.CreateVector(specificity));
return flatBufferTensorInfo;
}
@@ -1693,7 +1702,8 @@
0,
0,
static_cast<unsigned int>
- (tensorInfo.GetShape().GetDimensionality()));
+ (tensorInfo.GetShape().GetDimensionality()),
+ m_flatBufferBuilder.CreateVector(specificity));
return flatBufferTensorInfo;
}