From 584a2b83338a1190eb2d1840a477fd65b7dc4844 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Fri, 1 Nov 2019 13:29:48 +0000 Subject: Better error reporting for unconnected layers Change-Id: I3c461e5449cf4bfa94d6d5e8dee03c210f2734e5 Signed-off-by: Matthew Bentham --- src/armnn/Graph.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index 5e2acd55a3..4e02be3531 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -490,9 +490,22 @@ void Graph::InferTensorInfos() { for (auto&& input : layer->GetInputSlots()) { - boost::ignore_unused(input); - BOOST_ASSERT_MSG(input.GetConnectedOutputSlot()->IsTensorInfoSet(), - "All inputs must have the TensorInfo set at this point."); + const IOutputSlot* source = input.GetConnectedOutputSlot(); + if (source == NULL) + { + std::ostringstream message; + message << "Input not connected on " + << GetLayerTypeAsCString(layer->GetType()) + << " layer \"" + << layer->GetName() + << "\""; + throw LayerValidationException(message.str()); + } + + if (!source->IsTensorInfoSet()) + { + throw LayerValidationException("All inputs must have the TensorInfo set at this point."); + } } layer->ValidateTensorShapesFromInputs(); } -- cgit v1.2.1