From 000117b71491f1ddf1ded7f945689a3f629b9611 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Thu, 25 Jul 2019 16:24:49 +0100 Subject: IVGCVSW-3572 Fix tests failing due to usupported input tensor Signed-off-by: Aron Virginas-Tar Change-Id: I55502cf2abcf28a1c1810269f1955ca78b23c39a --- ConversionUtils.hpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index 790382d6..694e1b20 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -994,8 +994,26 @@ LayerInputHandle ConvertToLayerInputHandle(const HalOperation& operation, switch (operand->lifetime) { - case HalOperandLifeTime::TEMPORARY_VARIABLE: // intentional fallthrough case HalOperandLifeTime::MODEL_INPUT: + { + // NOTE: We must check whether we can support the input tensor on at least one + // of the provided backends; otherwise we cannot convert the operation + bool isInputSupported = false; + FORWARD_LAYER_SUPPORT_FUNC(__func__, + IsInputSupported, + data.m_Backends, + isInputSupported, + operandTensorInfo); + + if (!isInputSupported) + { + Fail("%s: unsupported input tensor", __func__); + return LayerInputHandle(); + } + + BOOST_FALLTHROUGH; // intentional fallthrough + } + case HalOperandLifeTime::TEMPORARY_VARIABLE: // intentional fallthrough case HalOperandLifeTime::MODEL_OUTPUT: { // The tensor is either an operand internal to the model, or a model input. @@ -1004,9 +1022,8 @@ LayerInputHandle ConvertToLayerInputHandle(const HalOperation& operation, // m_OutputSlotForOperand[...] can be nullptr if the previous layer could not be converted const uint32_t operandIndex = operation.inputs[inputIndex]; return LayerInputHandle(true, data.m_OutputSlotForOperand[operandIndex], operandTensorInfo); - break; } - case HalOperandLifeTime::CONSTANT_COPY: + case HalOperandLifeTime::CONSTANT_COPY: // intentional fallthrough case HalOperandLifeTime::CONSTANT_REFERENCE: { // The tensor has an already known constant value, and can be converted into an ArmNN Constant layer. -- cgit v1.2.1