From fb14ebbd68e04876809145296af96f6f41857418 Mon Sep 17 00:00:00 2001 From: James Ward Date: Thu, 26 Nov 2020 11:08:12 +0000 Subject: IVGCVSW-5348 Update Doxygen Docu * Update Doxygen Documentation for 20.11 release Signed-off-by: James Ward Change-Id: Ib47edac7923a642a277b1169d1085e5622021dc0 --- 20.11/_squash_equal_siblings_8hpp_source.xhtml | 135 +++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 20.11/_squash_equal_siblings_8hpp_source.xhtml (limited to '20.11/_squash_equal_siblings_8hpp_source.xhtml') diff --git a/20.11/_squash_equal_siblings_8hpp_source.xhtml b/20.11/_squash_equal_siblings_8hpp_source.xhtml new file mode 100644 index 0000000000..4ebf597dac --- /dev/null +++ b/20.11/_squash_equal_siblings_8hpp_source.xhtml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/optimizations/SquashEqualSiblings.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
SquashEqualSiblings.hpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "Optimization.hpp"
8 
11 
12 namespace armnn
13 {
14 namespace optimizations
15 {
16 
17 template <typename Comparable>
19 {
20 public:
21  /// Run for every connection between a base Layer (any) and a child ComparableLayer.
22  /// For all siblings of the child layer that compare equal to it, bypasses and removes
23  /// them. I.e., moves the connections in the outputs of the siblings to the outputs of
24  /// the child layer, so the siblings are left unconnected (and later removed).
25  void Run(Graph& graph, InputSlot& connection) const
26  {
27  IgnoreUnused(graph);
28  auto& child = connection.GetOwningLayer();
29 
30  if (!child.IsOutputUnconnected())
31  {
32  OutputSlot& baseOutput = *connection.GetConnectedOutputSlot();
33 
34  if (baseOutput.GetNumConnections() > 1)
35  {
36  auto& comparableChild = *PolymorphicDowncast<Comparable*>(&child);
37 
38  Layer* lowestPriorityChild = &child;
39  for (auto&& it : baseOutput.GetConnections())
40  {
41  Layer* sibling = &it->GetOwningLayer();
42  if ((sibling != lowestPriorityChild) && comparableChild.IsEqual(*sibling))
43  {
44  if (sibling->GetPriority() < lowestPriorityChild->GetPriority())
45  {
46  std::swap(sibling, lowestPriorityChild);
47  }
48  // Bypasses sibling. It will be removed as it's left unconnected.
49  auto siblingOut = sibling->BeginOutputSlots();
50  for (auto lowestPriorityChildOut = lowestPriorityChild->BeginOutputSlots();
51  lowestPriorityChildOut != lowestPriorityChild->EndOutputSlots(); ++lowestPriorityChildOut)
52  {
53  siblingOut->MoveAllConnections(*lowestPriorityChildOut);
54  ++siblingOut;
55  }
56  }
57  }
58  }
59  }
60  }
61 
62 protected:
63  SquashEqualSiblingsImpl() = default;
64  ~SquashEqualSiblingsImpl() = default;
65 };
66 
71 
72 } // namespace optimizations
73 } // namespace armnn
+ +
const std::vector< InputSlot * > & GetConnections() const
Definition: Layer.hpp:125
+ +
void swap(OriginsDescriptor &first, OriginsDescriptor &second)
+ + +
Copyright (c) 2020 ARM Limited.
+
void IgnoreUnused(Ts &&...)
+ +
unsigned int GetNumConnections() const override
Definition: Layer.hpp:138
+
LayerPriority GetPriority() const
Definition: Layer.cpp:298
+ +
const OutputSlot * GetConnectedOutputSlot() const
Definition: Layer.hpp:55
+
Layer & GetOwningLayer() const
Definition: Layer.hpp:52
+ + +
This layer represents a transpose operation.
+
std::vector< OutputSlot >::iterator BeginOutputSlots()
Definition: Layer.hpp:242
+ +
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between a base Layer (any) and a child ComparableLayer.
+ +
+
+ + + + -- cgit v1.2.1