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 --- ...1optimizations_1_1_move_transpose_up_impl.xhtml | 239 +++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 20.02/classarmnn_1_1optimizations_1_1_move_transpose_up_impl.xhtml (limited to '20.02/classarmnn_1_1optimizations_1_1_move_transpose_up_impl.xhtml') diff --git a/20.02/classarmnn_1_1optimizations_1_1_move_transpose_up_impl.xhtml b/20.02/classarmnn_1_1optimizations_1_1_move_transpose_up_impl.xhtml new file mode 100644 index 0000000000..5771e5a072 --- /dev/null +++ b/20.02/classarmnn_1_1optimizations_1_1_move_transpose_up_impl.xhtml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + +ArmNN: MoveTransposeUpImpl Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
MoveTransposeUpImpl Class Reference
+
+
+ +

#include <MoveTransposeUp.hpp>

+ + + + + +

+Public Member Functions

void Run (Graph &graph, InputSlot &connection) const
 Run for every connection between a base Layer (any) and a child TransposeLayer. More...
 
+ + + + + +

+Protected Member Functions

 MoveTransposeUpImpl ()=default
 
 ~MoveTransposeUpImpl ()=default
 
+

Detailed Description

+
+

Definition at line 15 of file MoveTransposeUp.hpp.

+

Constructor & Destructor Documentation

+ +

◆ MoveTransposeUpImpl()

+ +
+
+ + + + + +
+ + + + + + + +
MoveTransposeUpImpl ()
+
+protecteddefault
+
+ +

Referenced by MoveTransposeUpImpl::Run().

+ +
+
+ +

◆ ~MoveTransposeUpImpl()

+ +
+
+ + + + + +
+ + + + + + + +
~MoveTransposeUpImpl ()
+
+protecteddefault
+
+ +

Referenced by MoveTransposeUpImpl::Run().

+ +
+
+

Member Function Documentation

+ +

◆ Run()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Run (Graphgraph,
InputSlotconnection 
) const
+
+inline
+
+ +

Run for every connection between a base Layer (any) and a child TransposeLayer.

+

If the type of the base layer allows it, it moves the permutation to the inputs of the base layer. I.e., adds equivalent permutations before the inputs of the base layer and moves the connections in the output of the child transpose layer to the output of the base layer.

+ +

Definition at line 22 of file MoveTransposeUp.hpp.

+ +

References armnn::Activation, armnn::Addition, Layer::BeginInputSlots(), Layer::EndInputSlots(), armnn::FakeQuantization, armnn::Floor, InputSlot::GetConnectedOutputSlot(), Layer::GetInputSlot(), OutputSlot::GetNumConnections(), Layer::GetOutputHandler(), Layer::GetOutputSlot(), InputSlot::GetOwningLayer(), OutputSlot::GetOwningLayer(), Layer::GetType(), Graph::InsertNewLayer(), armnn::MemCopy, MoveTransposeUpImpl::MoveTransposeUpImpl(), armnn::Multiplication, OutputHandler::SetTensorInfo(), armnnUtils::TransposeTensorShape(), and MoveTransposeUpImpl::~MoveTransposeUpImpl().

+
23  {
24  OutputSlot& baseOutput = *connection.GetConnectedOutputSlot();
25 
26  if (baseOutput.GetNumConnections() == 1U)
27  {
28  Layer& base = baseOutput.GetOwningLayer();
29 
30  if (CanMoveTransposeToInputs(base))
31  {
32  auto transpose = boost::polymorphic_downcast<TransposeLayer*>(&connection.GetOwningLayer());
33  const PermutationVector& perm = transpose->GetPermutation();
34 
35  // Inserts an equivalent transpose before every input of the base layer.
36  for (auto baseInput = base.BeginInputSlots(); baseInput != base.EndInputSlots(); ++baseInput)
37  {
38  // Inserts a new transpose layer.
39  const std::string name = std::string("moved_up-") + transpose->GetName();
40  TransposeLayer& permLayer = *graph.InsertNewLayer<TransposeLayer>(*baseInput, perm, name.c_str());
41 
42  // Sets output tensor info for the new layer.
43  OutputSlot& parentOutput = *permLayer.GetInputSlot(0).GetConnectedOutputSlot();
44  const TensorInfo permOutInfo = armnnUtils::TransposeTensorShape(parentOutput.GetTensorInfo(), perm);
45  permLayer.GetOutputHandler().SetTensorInfo(permOutInfo);
46  }
47 
48  // Sets transposed output tensor info
49  const TensorInfo& childOutInfo = transpose->GetOutputHandler().GetTensorInfo();
50  base.GetOutputHandler().SetTensorInfo(childOutInfo);
51 
52  // Bypasses transpose. It will be removed as it's left unconnected.
53  transpose->GetOutputSlot().MoveAllConnections(base.GetOutputSlot());
54  }
55  }
56  }
armnn::TensorShape TransposeTensorShape(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)
Definition: Transpose.cpp:98
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ + + + -- cgit v1.2.1