From d78b891d30b9b3a1aaf29e46c1d008bdc6bcd674 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Tue, 30 Apr 2019 10:17:40 +0100 Subject: IVGCVSW-3021 Add end-to-end flow control integration test Currently asserts that the net fails to optimise as that is the expected behaviour, but it's complete enough to exercise most of the code in SwitchLayer.cpp and MergeLayer.cpp Also, fix a bug in SwitchLayer::ValidateTensorShapesFromInputs found by the new test. Also, make topological sort slightly more robust to missing connections as it should not be the job of the sorter to validate the graph. Change-Id: I30b9e2d4769ab14a6820284871a79a5bb3eef1ef Signed-off-by: Matthew Bentham --- src/armnn/Layer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/armnn/Layer.cpp') diff --git a/src/armnn/Layer.cpp b/src/armnn/Layer.cpp index 0a6328ba3d..ced87b095c 100644 --- a/src/armnn/Layer.cpp +++ b/src/armnn/Layer.cpp @@ -262,8 +262,17 @@ LayerPriority Layer::GetPriority() const auto maxPrio = [](const LayerPriority prio, const InputSlot& slot) -> LayerPriority { - const Layer& input = slot.GetConnectedOutputSlot()->GetOwningLayer(); - return std::max(prio, input.GetPriority()); + const OutputSlot *outputSlot = slot.GetConnectedOutputSlot(); + if (outputSlot) + { + const Layer& input = outputSlot->GetOwningLayer(); + return std::max(prio, input.GetPriority()); + } + else + { + // unconnected input slot + return prio; + } }; m_Visiting = true; -- cgit v1.2.1