diff options
author | Matthew Bentham <matthew.bentham@arm.com> | 2019-07-30 08:24:12 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-07-30 15:58:30 +0000 |
commit | 0cf01dce414db3ce9595a438cf3c3f10dd938450 (patch) | |
tree | 900e14259365c2998a9ad75f3edd18b375c11fd6 /src/armnn/NetworkUtils.cpp | |
parent | bc2e210785a63e8360839e4ded5d2c15c2dffaf5 (diff) | |
download | armnn-0cf01dce414db3ce9595a438cf3c3f10dd938450.tar.gz |
IVGCVSW-3581 Fix AddCopyLayers and associated tests
Take a copy of the MemoryStrategies for a layer before inserting
new connections. Use the copy when looking up the original MemoryStrategies
during the graph transformation.
Fix the unit tests for AddCopyLayers to have cases where copies are needed.
Fix the validation for clarity and correctness - was previously comparing
Layers by pointer when it should have been by name (as it was comparing
with a cloned graph).
Change-Id: Ie282dc11913e977b8151ce1ad8bfba5e11617d40
Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
Diffstat (limited to 'src/armnn/NetworkUtils.cpp')
-rw-r--r-- | src/armnn/NetworkUtils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/armnn/NetworkUtils.cpp b/src/armnn/NetworkUtils.cpp index 66940e4eb5..a3760a9c6b 100644 --- a/src/armnn/NetworkUtils.cpp +++ b/src/armnn/NetworkUtils.cpp @@ -86,7 +86,7 @@ std::vector<DebugLayer*> InsertDebugLayerAfter(Graph& graph, Layer& layer) debugLayers.reserve(layer.GetNumOutputSlots()); // Connect a DebugLayer to each output slot of the layer - for (auto&& outputSlot = layer.BeginOutputSlots(); outputSlot != layer.EndOutputSlots(); ++outputSlot) + for (auto outputSlot = layer.BeginOutputSlots(); outputSlot != layer.EndOutputSlots(); ++outputSlot) { const std::string debugName = std::string("DebugLayerAfter") + layer.GetNameStr(); @@ -94,6 +94,7 @@ std::vector<DebugLayer*> InsertDebugLayerAfter(Graph& graph, Layer& layer) graph.InsertNewLayer<DebugLayer>(*outputSlot, debugName.c_str()); // Sets output tensor info for the debug layer. + BOOST_ASSERT(debugLayer->GetInputSlot(0).GetConnectedOutputSlot() == &(*outputSlot)); TensorInfo debugInfo = debugLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(); debugLayer->GetOutputSlot().SetTensorInfo(debugInfo); |