From f86be93b7492b381370cae7bf71eca8572a0cbae Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Tue, 24 Aug 2021 16:27:15 +0100 Subject: IVGCVSW-5924 Update 21.08 Doxygen Documents * Also updated latest symlink. Signed-off-by: Matthew Sloyan Change-Id: If9b4e0e52464abdf797b9eb858ae19bcc64c2aea --- 21.08/_observable_test_8cpp_source.xhtml | 127 +++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 21.08/_observable_test_8cpp_source.xhtml (limited to '21.08/_observable_test_8cpp_source.xhtml') diff --git a/21.08/_observable_test_8cpp_source.xhtml b/21.08/_observable_test_8cpp_source.xhtml new file mode 100644 index 0000000000..aed293d932 --- /dev/null +++ b/21.08/_observable_test_8cpp_source.xhtml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/test/ObservableTest.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ObservableTest.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 <doctest/doctest.h>
7 
8 #include "Graph.hpp"
9 #include "Observable.hpp"
10 
11 TEST_SUITE("Observable")
12 {
13 TEST_CASE("AddedLayerObservableTest")
14 {
15  armnn::Graph graph;
16 
17  // Create a graph observable
18  armnn::AddedLayerObservable layerObservable(graph);
19 
20  // Add a few layers
21  auto output = graph.AddLayer<armnn::OutputLayer>(0, "output");
22  auto input = graph.InsertNewLayer<armnn::InputLayer>(output->GetInputSlot(0), 0, "input");
23 
24  // Check the observable has observed the changes
25  std::list<armnn::Layer*> testLayers({ output, input });
26 
27  CHECK(std::equal(layerObservable.begin(), layerObservable.end(),
28  testLayers.begin(), testLayers.end()));
29 }
30 
31 TEST_CASE("ClearAddedLayerObservableTest")
32 {
33  armnn::Graph graph;
34 
35  // Create a graph observable
36  armnn::AddedLayerObservable addedLayerObservable(graph);
37 
38  // Add a few layers
39  auto output = graph.AddLayer<armnn::OutputLayer>(0, "output");
40  graph.InsertNewLayer<armnn::InputLayer>(output->GetInputSlot(0), 0, "input");
41 
42  addedLayerObservable.Clear();
43 
44  // Check the observable has observed the changes
45  std::list<armnn::Layer*> emptyList({});
46 
47  CHECK(std::equal(addedLayerObservable.begin(), addedLayerObservable.end(),
48  emptyList.begin(), emptyList.end()));
49 }
50 
51 TEST_CASE("ErasedLayerNamesObservableTest")
52 {
53  armnn::Graph graph;
54 
55  // Create a graph observable
56  armnn::ErasedLayerNamesObservable erasedLayerNamesObservable(graph);
57 
58  // Add a few layers
59  auto output = graph.AddLayer<armnn::OutputLayer>(0, "output");
60  graph.InsertNewLayer<armnn::InputLayer>(output->GetInputSlot(0), 0, "input");
61 
62  graph.EraseLayer(output);
63 
64  // Check the observable has observed the changes
65  std::list<std::string> testList({"output"});
66 
67  CHECK(std::equal(erasedLayerNamesObservable.begin(), erasedLayerNamesObservable.end(),
68  testList.begin(), testList.end()));
69 }
70 
71 TEST_CASE("ClearErasedLayerNamesObservableTest")
72 {
73  armnn::Graph graph;
74 
75  // Create a graph observable
76  armnn::ErasedLayerNamesObservable erasedLayerNamesObservable(graph);
77 
78  // Add a few layers
79  auto output = graph.AddLayer<armnn::OutputLayer>(0, "output");
80  graph.InsertNewLayer<armnn::InputLayer>(output->GetInputSlot(0), 0, "input");
81 
82  graph.EraseLayer(output);
83 
84  erasedLayerNamesObservable.Clear();
85 
86  // Check the observable has observed the changes
87  std::list<std::string> emptyList({});
88 
89  CHECK(std::equal(erasedLayerNamesObservable.begin(), erasedLayerNamesObservable.end(),
90  emptyList.begin(), emptyList.end()));
91 }
92 
93 }
94 
+
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
+
void EraseLayer(Iterator pos)
Deletes the layer at the specified position.
Definition: Graph.hpp:449
+ +
TEST_SUITE("Observable")
+ +
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: OutputLayer.hpp:13
+ + + +
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: InputLayer.hpp:13
+ + +
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