From 51e0b138f9fd2bd5eb2f22d9e861e77d33397680 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Mon, 20 Apr 2020 16:12:06 +0100 Subject: IVGCVSW-4675 Fix VTS 1.3 GeneratedTest.Test/armnn_resize* * Added GetOptionalBool function * Added checks to Resize for unsupported operands AlignCorners and HalfPixelCenters !armnn:3062 Signed-off-by: David Monahan Change-Id: Ic0305014ed2638e3a3d1e7520972e3a2909e504b --- ConversionUtils.hpp | 37 +++++++++++++++++++++++++++++++++++++ ConversionUtils_1_2.hpp | 11 +++++++++++ 2 files changed, 48 insertions(+) diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index d19131ce..15381338 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -1051,6 +1051,43 @@ bool GetOptionalConvolutionDilationParams(const HalOperation& operation, return success; } +template +bool GetOptionalBool(const HalOperation& operation, + uint32_t inputIndex, + const HalModel& model, + const ConversionData& data) +{ + using HalOperand = typename HalPolicy::Operand; + + const HalOperand* operand = GetInputOperand(operation, inputIndex, model); + if (!operand) + { + return false; + } + + if (!IsBool(*operand)) + { + return false; + } + + const void* valueAddress = GetOperandValueReadOnlyAddress(*operand, model, data); + if (!valueAddress) + { + return false; + } + + if (*(static_cast(valueAddress))) + { + return true; + } + else + { + return false; + } +} + template diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp index 460c88bd..c87cb030 100644 --- a/ConversionUtils_1_2.hpp +++ b/ConversionUtils_1_2.hpp @@ -1825,6 +1825,17 @@ bool ConvertResize(const HalOperation& operation, return Fail("%s: Operand has invalid data type for resizing by scale", __func__); } + descriptor.m_BilinearAlignCorners = GetOptionalBool(operation, 4, model, data); + descriptor.m_HalfPixelCenters = GetOptionalBool(operation, 5, model, data); + if (descriptor.m_BilinearAlignCorners) + { + return Fail("%s: Resize Align Corners is not currently supported", __func__); + } + if (descriptor.m_HalfPixelCenters) + { + return Fail("%s: Resize Half Pixel Centers is not currently supported", __func__); + } + bool isSupported = false; FORWARD_LAYER_SUPPORT_FUNC(__func__, IsResizeSupported, -- cgit v1.2.1