From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_graph_utils_8cpp_source.xhtml | 130 +++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 20.02/_graph_utils_8cpp_source.xhtml (limited to '20.02/_graph_utils_8cpp_source.xhtml') diff --git a/20.02/_graph_utils_8cpp_source.xhtml b/20.02/_graph_utils_8cpp_source.xhtml new file mode 100644 index 0000000000..38fd3abe4e --- /dev/null +++ b/20.02/_graph_utils_8cpp_source.xhtml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/test/GraphUtils.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
GraphUtils.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "GraphUtils.hpp"
7 
8 bool GraphHasNamedLayer(const armnn::Graph& graph, const std::string& name)
9 {
10  for (auto&& layer : graph)
11  {
12  if (layer->GetName() == name)
13  {
14  return true;
15  }
16  }
17  return false;
18 }
19 
20 armnn::Layer* GetFirstLayerWithName(armnn::Graph& graph, const std::string& name)
21 {
22  for (auto&& layer : graph)
23  {
24  if (layer->GetNameStr() == name)
25  {
26  return layer;
27  }
28  }
29  return nullptr;
30 }
31 
32 bool CheckNumberOfInputSlot(armnn::Layer* layer, unsigned int num)
33 {
34  return layer->GetNumInputSlots() == num;
35 }
36 
37 bool CheckNumberOfOutputSlot(armnn::Layer* layer, unsigned int num)
38 {
39  return layer->GetNumOutputSlots() == num;
40 }
41 
42 bool IsConnected(armnn::Layer* srcLayer, armnn::Layer* destLayer,
43  unsigned int srcSlot, unsigned int destSlot,
44  const armnn::TensorInfo& expectedTensorInfo)
45 {
46  const armnn::IOutputSlot& outputSlot = srcLayer->GetOutputSlot(srcSlot);
47  const armnn::TensorInfo& tensorInfo = outputSlot.GetTensorInfo();
48  if (expectedTensorInfo != tensorInfo)
49  {
50  return false;
51  }
52  const unsigned int numConnections = outputSlot.GetNumConnections();
53  for (unsigned int c = 0; c < numConnections; ++c)
54  {
55  auto inputSlot = boost::polymorphic_downcast<const armnn::InputSlot*>(outputSlot.GetConnection(c));
56  if (inputSlot->GetOwningLayer().GetNameStr() == destLayer->GetNameStr() &&
57  inputSlot->GetSlotIndex() == destSlot)
58  {
59  return true;
60  }
61  }
62  return false;
63 }
unsigned int GetNumInputSlots() const override
Returns the number of connectable input slots.
Definition: Layer.hpp:307
+
armnn::Layer * GetFirstLayerWithName(armnn::Graph &graph, const std::string &name)
Definition: GraphUtils.cpp:20
+ +
bool GraphHasNamedLayer(const armnn::Graph &graph, const std::string &name)
Definition: GraphUtils.cpp:8
+
virtual const IInputSlot * GetConnection(unsigned int index) const =0
+
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
Definition: Layer.hpp:308
+
An output connection slot for a layer.
Definition: INetwork.hpp:37
+
const std::string & GetNameStr() const
Definition: Layer.hpp:216
+ + +
bool IsConnected(armnn::Layer *srcLayer, armnn::Layer *destLayer, unsigned int srcSlot, unsigned int destSlot, const armnn::TensorInfo &expectedTensorInfo)
Definition: GraphUtils.cpp:42
+
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:312
+
virtual const TensorInfo & GetTensorInfo() const =0
+
bool CheckNumberOfInputSlot(armnn::Layer *layer, unsigned int num)
Definition: GraphUtils.cpp:32
+
virtual unsigned int GetNumConnections() const =0
+
bool CheckNumberOfOutputSlot(armnn::Layer *layer, unsigned int num)
Definition: GraphUtils.cpp:37
+ +
+
+ + + + -- cgit v1.2.1