diff options
-rw-r--r-- | 1.2/HalPolicy.cpp | 6 | ||||
-rw-r--r-- | ConversionUtils.hpp | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/1.2/HalPolicy.cpp b/1.2/HalPolicy.cpp index 86b3bb78..7e9a2233 100644 --- a/1.2/HalPolicy.cpp +++ b/1.2/HalPolicy.cpp @@ -420,6 +420,12 @@ bool HalPolicy::ConvertDepthwiseConv2d(const Operation& operation, const Model& { return Fail("%s: Operand is invalid", __func__); } + if ( weightsOperand->dimensions[0] != 1) + { + return Fail("%s: Invalid weights; for depthwise convolution, dimension 0 must be 1 but it is %i", + __func__, weightsOperand->dimensions[0] ); + } + DepthwiseConvolution2dDescriptor desc; desc.m_DataLayout = DataLayout::NHWC; diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index de255803..e4ac4a5a 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -1590,10 +1590,13 @@ bool ConvertConcatenation(const Operation& operation, const Model& model, Conver return Fail("%s: Operation has invalid inputs", __func__); } - armnn::TensorShape operandShape = GetTensorShapeForOperand(*operand); - LayerInputHandle operandInputHandle = - ConvertToLayerInputHandle<HalPolicy>(operation, i, model, data); + LayerInputHandle operandInputHandle = ConvertToLayerInputHandle<HalPolicy>(operation, i, model, data); + if (!operandInputHandle.IsValid()) + { + return Fail("%s: Operation has invalid inputs", __func__); + } + armnn::TensorShape operandShape = GetTensorShapeForOperand(*operand); if (operandShape.GetNumDimensions() == 0) { return Fail("%s: Operands with rank 0 are not supported", __func__); |