From 8f3d33ef6f86a4512f268931e09de0b0487e0ecd Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Mon, 6 Jul 2020 15:41:43 +0100 Subject: IVGCVSW-4988 Add handling output shape parameter to TransposeConvolution2d * Updating ConvertTransposeConv2d to populate m_OutputShape if found in the model. Signed-off-by: Colm Donelan Change-Id: I8c0c8184fdf29d81639dac8af36a9f1f048296b2 --- ConversionUtils_1_2.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp index 0a153996..817aebd1 100644 --- a/ConversionUtils_1_2.hpp +++ b/ConversionUtils_1_2.hpp @@ -2613,6 +2613,19 @@ bool ConvertTransposeConv2d(const HalOperation& operation, const HalModel& model return Fail("%s: Negative padding values are not supported", __func__); } + // If output shape has been specified as a parameter then extract it and make it available. + const HalOperand* outputShapeOperand = GetInputOperand(operation, 3, model, false); + std::vector outputShape; + if ((outputShapeOperand) && (GetTensorInt32Values(*outputShapeOperand, outputShape, model, data))) + { + // Change from signed to unsigned int to store in TransposeConvolution2dDescriptor. + for (int dimension : outputShape) + { + desc.m_OutputShape.push_back(static_cast(dimension)); + } + desc.m_OutputShapeEnabled = true; + } + desc.m_StrideX = boost::numeric_cast(strideX); desc.m_StrideY = boost::numeric_cast(strideY); desc.m_PadLeft = boost::numeric_cast(padLeft); -- cgit v1.2.1