From 0ad3ef15b7b731e9b722123f8763b2f1e3783cb8 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Fri, 3 Jul 2020 15:54:28 +0100 Subject: IVGCVSW-4988 Add handling output shape parameter to TransposeConvolution2d * Add m_OutputShape and m_OutputShapeEnabled to TransposeConvolution2dDescriptor. * Update TfLite parser to populate m_OutputShape if found in the model. Handle both Signed32 from tflite files and QAsymmU8 from test fixtures. * Update TransposeConvolution2dLayer to use m_OutputShape instead of InferOutputShapes if specified. Signed-off-by: Colm Donelan Change-Id: Ia6933065375eb8006c916f1ca67c38dc50bc205c --- include/armnn/Descriptors.hpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'include/armnn/Descriptors.hpp') diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index 60aa219638..241b23d4ed 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -1203,37 +1203,43 @@ struct TransposeConvolution2dDescriptor m_StrideX(0), m_StrideY(0), m_BiasEnabled(false), - m_DataLayout(DataLayout::NCHW) + m_DataLayout(DataLayout::NCHW), + m_OutputShapeEnabled(false) {} bool operator ==(const TransposeConvolution2dDescriptor& rhs) const { - return m_PadLeft == rhs.m_PadLeft && - m_PadRight == rhs.m_PadRight && - m_PadTop == rhs.m_PadTop && - m_PadBottom == rhs.m_PadBottom && - m_StrideX == rhs.m_StrideX && - m_StrideY == rhs.m_StrideY && - m_BiasEnabled == rhs.m_BiasEnabled && - m_DataLayout == rhs.m_DataLayout; + return m_PadLeft == rhs.m_PadLeft && + m_PadRight == rhs.m_PadRight && + m_PadTop == rhs.m_PadTop && + m_PadBottom == rhs.m_PadBottom && + m_StrideX == rhs.m_StrideX && + m_StrideY == rhs.m_StrideY && + m_BiasEnabled == rhs.m_BiasEnabled && + m_DataLayout == rhs.m_DataLayout && + m_OutputShapeEnabled == rhs.m_OutputShapeEnabled && + m_OutputShape == rhs.m_OutputShape; } /// Padding left value in the width dimension. - uint32_t m_PadLeft; + uint32_t m_PadLeft; /// Padding right value in the width dimension. - uint32_t m_PadRight; + uint32_t m_PadRight; /// Padding top value in the height dimension. - uint32_t m_PadTop; + uint32_t m_PadTop; /// Padding bottom value in the height dimension. - uint32_t m_PadBottom; + uint32_t m_PadBottom; /// Stride value when proceeding through input for the width dimension. - uint32_t m_StrideX; + uint32_t m_StrideX; /// Stride value when proceeding through input for the height dimension. - uint32_t m_StrideY; + uint32_t m_StrideY; /// Enable/disable bias. - bool m_BiasEnabled; + bool m_BiasEnabled; /// The data layout to be used (NCHW, NHWC). - DataLayout m_DataLayout; + DataLayout m_DataLayout; + /// Output shape if it has been specified. + bool m_OutputShapeEnabled; + std::vector m_OutputShape; }; /// A TransposeDescriptor for the TransposeLayer. -- cgit v1.2.1