23.05
INodeVisitor.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018-2021 Arm Limited.
3
*
4
* SPDX-License-Identifier: MIT
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in all
14
* copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* SOFTWARE.
23
*/
24
#ifndef ARM_COMPUTE_GRAPH_INODEVISITOR_H
25
#define ARM_COMPUTE_GRAPH_INODEVISITOR_H
26
27
#include "
arm_compute/graph/nodes/NodesFwd.h
"
28
29
namespace
arm_compute
30
{
31
namespace
graph
32
{
33
/** Node visitor interface */
34
class
INodeVisitor
35
{
36
public
:
37
/** Default destructor. */
38
virtual
~INodeVisitor
() =
default
;
39
/** Visit INode.
40
*
41
* @param[in] n Node to visit.
42
*/
43
virtual
void
visit
(
INode
&
n
) = 0;
44
/** Visit ActivationLayerNode.
45
*
46
* @param[in] n Node to visit.
47
*/
48
virtual
void
visit
(
ActivationLayerNode
&n) = 0;
49
/** Visit BatchNormalizationLayerNode.
50
*
51
* @param[in] n Node to visit.
52
*/
53
virtual
void
visit
(
BatchNormalizationLayerNode
&n) = 0;
54
/** Visit ConcatenateLayerNode.
55
*
56
* @param[in] n Node to visit.
57
*/
58
virtual
void
visit
(
ConcatenateLayerNode
&n) = 0;
59
/** Visit ConstNode.
60
*
61
* @param[in] n Node to visit.
62
*/
63
virtual
void
visit
(
ConstNode
&n) = 0;
64
/** Visit ConvolutionLayerNode.
65
*
66
* @param[in] n Node to visit.
67
*/
68
virtual
void
visit
(
ConvolutionLayerNode
&n) = 0;
69
/** Visit DepthwiseConvolutionLayerNode.
70
*
71
* @param[in] n Node to visit.
72
*/
73
virtual
void
visit
(
DepthwiseConvolutionLayerNode
&n) = 0;
74
/** Visit DequantizationLayerNode.
75
*
76
* @param[in] n Node to visit.
77
*/
78
virtual
void
visit
(
DequantizationLayerNode
&n) = 0;
79
/** Visit DetectionOutputLayerNode.
80
*
81
* @param[in] n Node to visit.
82
*/
83
virtual
void
visit
(
DetectionOutputLayerNode
&n) = 0;
84
/** Visit DetectionPostProcessLayerNode.
85
*
86
* @param[in] n Node to visit.
87
*/
88
virtual
void
visit
(
DetectionPostProcessLayerNode
&n) = 0;
89
/** Visit EltwiseLayerNode.
90
*
91
* @param[in] n Node to visit.
92
*/
93
virtual
void
visit
(
EltwiseLayerNode
&n) = 0;
94
/** Visit FlattenLayerNode.
95
*
96
* @param[in] n Node to visit.
97
*/
98
virtual
void
visit
(
FlattenLayerNode
&n) = 0;
99
/** Visit FullyConnectedLayerNode.
100
*
101
* @param[in] n Node to visit.
102
*/
103
virtual
void
visit
(
FullyConnectedLayerNode
&n) = 0;
104
/** Visit FusedConvolutionBatchNormalizationNode.
105
*
106
* @param[in] n Node to visit.
107
*/
108
virtual
void
visit
(
FusedConvolutionBatchNormalizationNode
&n) = 0;
109
/** Visit FusedConvolutionBatchNormalizationWithPostOpsNode.
110
*
111
* @param[in] n Node to visit.
112
*/
113
virtual
void
visit
(
FusedConvolutionBatchNormalizationWithPostOpsNode
&n) = 0;
114
/** Visit FusedConvolutionWithPostOpNode.
115
*
116
* @param[in] n Node to visit.
117
*/
118
virtual
void
visit
(
FusedConvolutionWithPostOpNode
&n) = 0;
119
/** Visit FusedDepthwiseConvolutionBatchNormalizationNode.
120
*
121
* @param[in] n Node to visit.
122
*/
123
virtual
void
visit
(
FusedDepthwiseConvolutionBatchNormalizationNode
&n) = 0;
124
/** Visit InputNode.
125
*
126
* @param[in] n Node to visit.
127
*/
128
virtual
void
visit
(
InputNode
&n) = 0;
129
/** Visit NormalizationLayerNode.
130
*
131
* @param[in] n Node to visit.
132
*/
133
virtual
void
visit
(
NormalizationLayerNode
&n) = 0;
134
/** Visit OutputNode.
135
*
136
* @param[in] n Node to visit.
137
*/
138
virtual
void
visit
(
OutputNode
&n) = 0;
139
/** Visit PermuteLayerNode.
140
*
141
* @param[in] n Node to visit.
142
*/
143
virtual
void
visit
(
PermuteLayerNode
&n) = 0;
144
/** Visit PreluLayerNode.
145
*
146
* @param[in] n Node to visit.
147
*/
148
virtual
void
visit
(
PReluLayerNode
&n) = 0;
149
/** Visit PoolingLayerNode.
150
*
151
* @param[in] n Node to visit.
152
*/
153
virtual
void
visit
(
PoolingLayerNode
&n) = 0;
154
/** Visit PrintLayerNode.
155
*
156
* @param[in] n Node to visit.
157
*/
158
virtual
void
visit
(
PrintLayerNode
&n) = 0;
159
/** Visit PriorBoxLayerNode.
160
*
161
* @param[in] n Node to visit.
162
*/
163
virtual
void
visit
(
PriorBoxLayerNode
&n) = 0;
164
/** Visit QuantizationLayerNode.
165
*
166
* @param[in] n Node to visit.
167
*/
168
virtual
void
visit
(
QuantizationLayerNode
&n) = 0;
169
/** Visit ReshapeLayerNode.
170
*
171
* @param[in] n Node to visit.
172
*/
173
virtual
void
visit
(
ReshapeLayerNode
&n) = 0;
174
/** Visit SoftmaxLayerNode.
175
*
176
* @param[in] n Node to visit.
177
*/
178
virtual
void
visit
(
SoftmaxLayerNode
&n) = 0;
179
/** Visit SplitLayerNode.
180
*
181
* @param[in] n Node to visit.
182
*/
183
virtual
void
visit
(
SplitLayerNode
&n) = 0;
184
/** Visit StackLayerNode.
185
*
186
* @param[in] n Node to visit.
187
*/
188
virtual
void
visit
(
StackLayerNode
&n) = 0;
189
};
190
191
/** Default visitor implementation
192
*
193
* Implements visit methods by calling a default function.
194
* Inherit from DefaultNodeVisitor if you don't want to provide specific implementation for all nodes.
195
*/
196
class
DefaultNodeVisitor
:
public
INodeVisitor
197
{
198
public
:
199
/** Default destructor */
200
virtual
~
DefaultNodeVisitor
() =
default
;
201
202
#ifndef DOXYGEN_SKIP_THIS
203
// Inherited methods overridden
204
virtual
void
visit
(
INode
&
n
)
override
;
205
virtual
void
visit
(
ActivationLayerNode
&n)
override
;
206
virtual
void
visit
(
BatchNormalizationLayerNode
&n)
override
;
207
virtual
void
visit
(
ConcatenateLayerNode
&n)
override
;
208
virtual
void
visit
(
ConstNode
&n)
override
;
209
virtual
void
visit
(
ConvolutionLayerNode
&n)
override
;
210
virtual
void
visit
(
DequantizationLayerNode
&n)
override
;
211
virtual
void
visit
(
DetectionOutputLayerNode
&n)
override
;
212
virtual
void
visit
(
DetectionPostProcessLayerNode
&n)
override
;
213
virtual
void
visit
(
DepthwiseConvolutionLayerNode
&n)
override
;
214
virtual
void
visit
(
EltwiseLayerNode
&n)
override
;
215
virtual
void
visit
(
FlattenLayerNode
&n)
override
;
216
virtual
void
visit
(
FullyConnectedLayerNode
&n)
override
;
217
virtual
void
visit
(
FusedConvolutionBatchNormalizationNode
&n)
override
;
218
virtual
void
visit
(
FusedConvolutionBatchNormalizationWithPostOpsNode
&n)
override
;
219
virtual
void
visit
(
FusedConvolutionWithPostOpNode
&n)
override
;
220
virtual
void
visit
(
FusedDepthwiseConvolutionBatchNormalizationNode
&n)
override
;
221
virtual
void
visit
(
InputNode
&n)
override
;
222
virtual
void
visit
(
NormalizationLayerNode
&n)
override
;
223
virtual
void
visit
(
OutputNode
&n)
override
;
224
virtual
void
visit
(
PermuteLayerNode
&n)
override
;
225
virtual
void
visit
(
PoolingLayerNode
&n)
override
;
226
virtual
void
visit
(
PReluLayerNode
&n)
override
;
227
virtual
void
visit
(
PrintLayerNode
&n)
override
;
228
virtual
void
visit
(
PriorBoxLayerNode
&n)
override
;
229
virtual
void
visit
(
QuantizationLayerNode
&n)
override
;
230
virtual
void
visit
(
ReshapeLayerNode
&n)
override
;
231
virtual
void
visit
(
SoftmaxLayerNode
&n)
override
;
232
virtual
void
visit
(
SplitLayerNode
&n)
override
;
233
virtual
void
visit
(
StackLayerNode
&n)
override
;
234
#endif
/* DOXYGEN_SKIP_THIS */
235
236
/** Function to be overloaded by the client and implement default behavior for the
237
* non-overloaded visitors
238
*/
239
virtual
void
default_visit(
INode
&n) = 0;
240
};
241
}
// namespace graph
242
}
// namespace arm_compute
243
#endif
/* ARM_COMPUTE_GRAPH_INODEVISITOR_H */
arm_compute::graph::SplitLayerNode
Split Layer node.
Definition:
SplitLayerNode.h:36
arm_compute::graph::EltwiseLayerNode
Eltwise Layer node.
Definition:
EltwiseLayerNode.h:34
arm_compute::graph::DefaultNodeVisitor
Default visitor implementation.
Definition:
INodeVisitor.h:196
arm_compute::graph::BatchNormalizationLayerNode
Batch Normalization Layer node.
Definition:
BatchNormalizationLayerNode.h:34
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode
Fused Depthwise Convolution Batch Normalization node.
Definition:
FusedDepthwiseConvolutionBatchNormalizationNode.h:34
arm_compute::graph::NormalizationLayerNode
Normalization Layer node.
Definition:
NormalizationLayerNode.h:34
NodesFwd.h
arm_compute::graph::FlattenLayerNode
Flatten Layer node.
Definition:
FlattenLayerNode.h:34
arm_compute::graph::PermuteLayerNode
Permute Layer node.
Definition:
PermuteLayerNode.h:34
arm_compute::graph::PoolingLayerNode
Pooling Layer node.
Definition:
PoolingLayerNode.h:34
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition:
introduction.dox:24
arm_compute::graph::FusedConvolutionBatchNormalizationNode
Batch Normalization node.
Definition:
FusedConvolutionBatchNormalizationNode.h:34
arm_compute::graph::ConvolutionLayerNode
Convolution Layer node.
Definition:
ConvolutionLayerNode.h:34
arm_compute::graph::StackLayerNode
Stack Layer node.
Definition:
StackLayerNode.h:34
arm_compute::graph::INode
Node interface.
Definition:
INode.h:46
arm_compute::graph::INodeVisitor::visit
virtual void visit(INode &n)=0
Visit INode.
arm_compute::graph::QuantizationLayerNode
Quantization Layer node.
Definition:
QuantizationLayerNode.h:34
arm_compute::graph::PriorBoxLayerNode
PriorBox Layer node.
Definition:
PriorBoxLayerNode.h:34
arm_compute::graph::DequantizationLayerNode
Dequantize Layer node.
Definition:
DequantizationLayerNode.h:38
arm_compute::graph::OutputNode
Output Layer node.
Definition:
OutputNode.h:34
arm_compute::graph::ReshapeLayerNode
Reshape Layer node.
Definition:
ReshapeLayerNode.h:34
arm_compute::graph::ConcatenateLayerNode
Concatenation Layer node.
Definition:
ConcatenateLayerNode.h:34
arm_compute::graph::FusedConvolutionBatchNormalizationWithPostOpsNode
Batch Normalization node.
Definition:
FusedConvolutionBatchNormalizationWithPostOpsNode.h:34
arm_compute::graph::SoftmaxLayerNode
Softmax Layer node.
Definition:
SoftmaxLayerNode.h:34
arm_compute::graph::InputNode
Input Layer node.
Definition:
InputNode.h:34
arm_compute::graph::PReluLayerNode
PRelu Layer node.
Definition:
PReluLayerNode.h:34
arm_compute::graph::DetectionPostProcessLayerNode
DetectionPostProcess Layer node.
Definition:
DetectionPostProcessLayerNode.h:34
arm_compute::graph::ActivationLayerNode
Activation Layer node.
Definition:
ActivationLayerNode.h:34
arm_compute::graph::DetectionOutputLayerNode
DetectionOutput Layer node.
Definition:
DetectionOutputLayerNode.h:34
arm_compute::graph::ConstNode
Const node.
Definition:
ConstNode.h:34
arm_compute::graph::INodeVisitor::~INodeVisitor
virtual ~INodeVisitor()=default
Default destructor.
arm_compute::graph::FullyConnectedLayerNode
Fully Connected Layer node.
Definition:
FullyConnectedLayerNode.h:34
arm_compute::graph::DepthwiseConvolutionLayerNode
Depthwise Convolution Layer node.
Definition:
DepthwiseConvolutionLayerNode.h:34
arm_compute::graph::INodeVisitor
Node visitor interface.
Definition:
INodeVisitor.h:34
arm_compute::graph::PrintLayerNode
Print Layer node.
Definition:
PrintLayerNode.h:37
arm_compute::graph::FusedConvolutionWithPostOpNode
Convolution node.
Definition:
FusedConvolutionWithPostOpNode.h:36
arm_compute::test::validation::n
const unsigned int n
Definition:
GEMMMatrixMultiplyNative.cpp:360
arm_compute
graph
INodeVisitor.h
Generated on Thu May 18 2023 14:52:23 for Compute Library by
1.8.13