diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-07-25 16:24:49 +0100 |
---|---|---|
committer | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-07-25 16:24:49 +0100 |
commit | 000117b71491f1ddf1ded7f945689a3f629b9611 (patch) | |
tree | 3d1f8d26a72d2b723155d841cabff53b581d4c2a | |
parent | 3892a36f6005086318c7df3ec83d7babb6078430 (diff) | |
download | android-nn-driver-000117b71491f1ddf1ded7f945689a3f629b9611.tar.gz |
IVGCVSW-3572 Fix tests failing due to usupported input tensor
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Change-Id: I55502cf2abcf28a1c1810269f1955ca78b23c39a
-rw-r--r-- | ConversionUtils.hpp | 23 |
1 files 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. |