From f9afc791662f9ffd639a9500de8c4e33394c8c39 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Thu, 6 Dec 2018 12:03:17 +0000 Subject: IVGCVSW-2268 Remove the input swizzling from ParseConcat * Removed the input swizzling when the concatenation dimension is 3 in ParseConcat in the TF parser * No longer using the helper ProcessConcatInputTensorInfo, where the input was being swizzled if the concatenation dimension was 3 * Added a new convenience constuctor to TensorShape that initializes a shape to all zeros given only the number of dimensions Change-Id: I82a207e41bddc5fea21a0b5a38eafa24ad75d1c2 --- src/armnn/Tensor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/armnn') diff --git a/src/armnn/Tensor.cpp b/src/armnn/Tensor.cpp index 8e72d4694c..6e09e3bc59 100644 --- a/src/armnn/Tensor.cpp +++ b/src/armnn/Tensor.cpp @@ -23,6 +23,22 @@ TensorShape::TensorShape() { } +TensorShape::TensorShape(unsigned int numDimensions) + : m_NumDimensions(numDimensions) +{ + if (numDimensions < 1) + { + throw InvalidArgumentException("Tensor numDimensions must be greater than 0"); + } + + if (numDimensions > MaxNumOfTensorDimensions) + { + throw InvalidArgumentException("Tensor numDimensions must be less than or equal to MaxNumOfTensorDimensions"); + } + + std::fill(m_Dimensions.begin(), m_Dimensions.begin() + m_NumDimensions, 0); +} + TensorShape::TensorShape(const unsigned int numDimensions, const unsigned int* const dimensionSizes) : m_NumDimensions(numDimensions) { -- cgit v1.2.1