From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_transpose_as_reshape_tests_8cpp.xhtml | 166 +++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 21.02/_transpose_as_reshape_tests_8cpp.xhtml (limited to '21.02/_transpose_as_reshape_tests_8cpp.xhtml') diff --git a/21.02/_transpose_as_reshape_tests_8cpp.xhtml b/21.02/_transpose_as_reshape_tests_8cpp.xhtml new file mode 100644 index 0000000000..2cf3c2a3fa --- /dev/null +++ b/21.02/_transpose_as_reshape_tests_8cpp.xhtml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/test/optimizations/TransposeAsReshapeTests.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
TransposeAsReshapeTests.cpp File Reference
+
+
+
#include "../TestUtils.hpp"
+#include <Optimizer.hpp>
+#include <boost/test/unit_test.hpp>
+
+

Go to the source code of this file.

+ + + + +

+Functions

 BOOST_AUTO_TEST_CASE (TransposeAsReshapeTest)
 
+

Function Documentation

+ +

◆ BOOST_AUTO_TEST_CASE()

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (TransposeAsReshapeTest )
+
+ +

Definition at line 17 of file TransposeAsReshapeTests.cpp.

+ +

References Graph::AddLayer(), BOOST_AUTO_TEST_SUITE_END(), Graph::cbegin(), Graph::cend(), CheckSequence(), armnn::Float32, Graph::InsertNewLayer(), armnn::MakeOptimizations(), and Optimizer::Pass().

+
18 {
19  armnn::Graph graph;
20 
21  std::string transposeLayerName = "transpose";
22 
23  const armnn::TensorInfo infoIn({ 1, 2, 3, 1 }, armnn::DataType::Float32);
24  const armnn::TensorInfo infoOut({ 1, 1, 2, 3 }, armnn::DataType::Float32);
25 
26  auto output = graph.AddLayer<armnn::OutputLayer>(0, "output");
27 
28  graph.InsertNewLayer<armnn::InputLayer>(output->GetInputSlot(0), 0, "input")
29  ->GetOutputHandler()
30  .SetTensorInfo(infoIn);
31 
32  // Inserts transpose.
33  graph
34  .InsertNewLayer<armnn::TransposeLayer>(output->GetInputSlot(0), armnn::TransposeDescriptor({ 0, 3, 1, 2 }),
35  transposeLayerName.c_str())
36  ->GetOutputHandler()
37  .SetTensorInfo(infoOut);
38 
39  BOOST_TEST(CheckSequence(graph.cbegin(), graph.cend(), &IsLayerOfType<armnn::InputLayer>,
40  &IsLayerOfType<armnn::TransposeLayer>, &IsLayerOfType<armnn::OutputLayer>));
41 
43 
44  // The transpose is replaced by an equivalent reshape.
45 
46  auto checkReshape = [&infoOut](const armnn::Layer* const layer) -> bool {
47  const auto reshapeLayer = static_cast<const armnn::ReshapeLayer*>(layer);
48  return IsLayerOfType<armnn::ReshapeLayer>(layer) &&
49  (reshapeLayer->GetParameters().m_TargetShape == infoOut.GetShape()) &&
50  (reshapeLayer->GetOutputHandler().GetTensorInfo().GetShape() == infoOut.GetShape());
51  };
52 
53  BOOST_TEST(CheckSequence(graph.cbegin(), graph.cend(), &IsLayerOfType<armnn::InputLayer>, checkReshape,
54  &IsLayerOfType<armnn::OutputLayer>));
55 
56  std::list<std::string> testRelatedLayers = { transposeLayerName };
57  BOOST_TEST(CheckRelatedLayers<armnn::ReshapeLayer>(graph, testRelatedLayers));
58 }
Optimizer::Optimizations MakeOptimizations(Args &&... args)
Definition: Optimizer.hpp:43
+ +
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
+
ConstIterator cbegin() const
Returns const iterator pointing to the beginning of the list. Lowercase for range-based for loops...
Definition: Graph.hpp:172
+
static void Pass(Graph &graph, const Optimizations &optimizations)
Definition: Optimizer.cpp:16
+
This layer represents a reshape operation.
+
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: OutputLayer.hpp:13
+
OptimizeForType< TransposeLayer, TransposeAsReshapeImpl > TransposeAsReshape
+ +
This layer represents a transpose operation.
+
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: InputLayer.hpp:13
+
bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last)
Definition: TestUtils.hpp:21
+
A TransposeDescriptor for the TransposeLayer.
+ +
ConstIterator cend() const
Returns const iterator pointing to the end of the list. Lowercase for range-based for loops...
Definition: Graph.hpp:174
+
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...
Definition: Graph.hpp:416
+ +
+
+
+
+
+ + + + -- cgit v1.2.1