diff options
author | Rob Hughes <robert.hughes@arm.com> | 2021-02-18 11:50:22 +0000 |
---|---|---|
committer | Rob Hughes <robert.hughes@arm.com> | 2021-02-19 09:16:05 +0000 |
commit | 0fb4c23953d4e824081e1f2f789301ec311f7fca (patch) | |
tree | 429caac23619b3cec3acbfe17f6fe3d2c3fd5231 /src/armnn/NetworkUtils.cpp | |
parent | ea4fce735cd0ae70d6ea6a82a5550764bcf05d30 (diff) | |
download | armnn-0fb4c23953d4e824081e1f2f789301ec311f7fca.tar.gz |
Give unique names to debug layers
Debug layers are given names based on the layer they take their input from.
If a layer has multiple outputs then one debug layer will be attached to
each output. Therefore all these debug layers would have identical names
making them hard to distinguish when debugging. This patch includes the
output slot index which the debug layer takes its input from when creating
the name.
Change-Id: I09eaa8a7edad9bfdf678b4778cf740340013126c
Signed-off-by: Rob Hughes <robert.hughes@arm.com>
Diffstat (limited to 'src/armnn/NetworkUtils.cpp')
-rw-r--r-- | src/armnn/NetworkUtils.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/armnn/NetworkUtils.cpp b/src/armnn/NetworkUtils.cpp index 285da4c9a9..666ce3d069 100644 --- a/src/armnn/NetworkUtils.cpp +++ b/src/armnn/NetworkUtils.cpp @@ -237,9 +237,11 @@ std::vector<DebugLayer*> InsertDebugLayerAfter(Graph& graph, Layer& layer) debugLayers.reserve(layer.GetNumOutputSlots()); // Connect a DebugLayer to each output slot of the layer + uint32_t outputSlotIdx = 0; for (auto outputSlot = layer.BeginOutputSlots(); outputSlot != layer.EndOutputSlots(); ++outputSlot) { - const std::string debugName = std::string("DebugLayerAfter") + layer.GetNameStr(); + const std::string debugName = std::string("DebugLayerAfter") + layer.GetNameStr() + "_" + + std::to_string(outputSlotIdx); DebugLayer* debugLayer = graph.InsertNewLayer<DebugLayer>(*outputSlot, debugName.c_str()); @@ -254,6 +256,8 @@ std::vector<DebugLayer*> InsertDebugLayerAfter(Graph& graph, Layer& layer) debugLayer->SetBackendId(Compute::CpuRef); debugLayers.emplace_back(debugLayer); + + ++outputSlotIdx; } return debugLayers; |