ArmNN
 22.02
ILayerVisitor.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <armnn/Deprecated.hpp>
9 #include <armnn/NetworkFwd.hpp>
10 #include <armnn/Optional.hpp>
11 #include <armnn/TensorFwd.hpp>
12 #include <armnn/Types.hpp>
13 
14 namespace armnn
15 {
16 class ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable IStrategy instead.", "22.05") ILayerVisitor
17 {
18 protected:
19  ILayerVisitor() {}
20  virtual ~ILayerVisitor() {}
21 
22 public:
23 
24  /// Function that an activation layer should call back to when its Accept(ILayerVisitor&) function is invoked.
25  /// @param layer - pointer to the layer which is calling back to this visit function.
26  /// @param activationDescriptor - ActivationDescriptor to configure the activation.
27  /// @param name - Optional name for the layer.
28  virtual void VisitActivationLayer(const IConnectableLayer* layer,
29  const ActivationDescriptor& activationDescriptor,
30  const char* name = nullptr) = 0;
31 
32  /// Function that an addition layer should call back to when its Accept(ILayerVisitor&) function is invoked.
33  /// @param layer - pointer to the layer which is calling back to this visit function.
34  /// @param name - Optional name for the layer.
35  virtual void VisitAdditionLayer(const IConnectableLayer* layer,
36  const char* name = nullptr) = 0;
37 
38  /// Function that an arg min max layer should call back to when its Accept(ILayerVisitor&) function is invoked.
39  /// @param layer - pointer to the layer which is calling back to this visit function.
40  /// @param argMinMaxDescriptor - ArgMinMaxDescriptor to configure the activation.
41  /// @param name - Optional name for the layer.
42  virtual void VisitArgMinMaxLayer(const IConnectableLayer* layer,
43  const ArgMinMaxDescriptor& argMinMaxDescriptor,
44  const char* name = nullptr) = 0;
45 
46  /// Function that a batch normalization layer should call back to when its Accept(ILayerVisitor&)
47  /// function is invoked.
48  /// @param layer - pointer to the layer which is calling back to this visit function.
49  /// @param mean - Pre-calculated mean for each channel.
50  /// @param variance - Pre-calculated variance for each channel.
51  /// @param beta - Per-channel additive factor.
52  /// @param gamma - Per-channel multiplicative factor.
53  /// @param name - Optional name for the layer.
54  virtual void VisitBatchNormalizationLayer(const IConnectableLayer* layer,
55  const BatchNormalizationDescriptor& desc,
56  const ConstTensor& mean,
57  const ConstTensor& variance,
58  const ConstTensor& beta,
59  const ConstTensor& gamma,
60  const char* name = nullptr) = 0;
61 
62  /// Function that a batch to space ND layer should call back to when its Accept(ILayerVisitor&)
63  /// function is invoked.
64  /// @param layer - pointer to the layer which is calling back to this visit function.
65  /// @param batchToSpaceNdDescriptor - Description of the layer.
66  /// @param name - Optional name for the layer.
67  virtual void VisitBatchToSpaceNdLayer(const IConnectableLayer* layer,
68  const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
69  const char* name = nullptr) = 0;
70 
71  /// Function a Comparison layer should call back to when its Accept(ILayerVisitor&) function is invoked.
72  /// @param layer - pointer to the layer which is calling back to this visit function.
73  /// @param comparisonDescriptor - Description of the layer.
74  /// @param name - Optional name for the layer.
75  virtual void VisitComparisonLayer(const IConnectableLayer* layer,
76  const ComparisonDescriptor& comparisonDescriptor,
77  const char* name = nullptr) = 0;
78 
79  /// Function that a concat layer should call back to when its Accept(ILayerVisitor&) function is invoked.
80  /// @param layer - pointer to the layer which is calling back to this visit function.
81  /// @param concatDescriptor - ConcatDescriptor (synonym for OriginsDescriptor) to configure the concatenation
82  /// process. Number of Views must be equal to the number of inputs, and their order
83  /// must match - e.g. first view corresponds to the first input, second view to the
84  /// second input, etc....
85  /// @param name - Optional name for the layer.
86  virtual void VisitConcatLayer(const IConnectableLayer* layer,
87  const OriginsDescriptor& concatDescriptor,
88  const char* name = nullptr) = 0;
89 
90  /// Function a layer with no inputs and a single output, which always corresponds to
91  /// the passed in constant tensor should call back to when its Accept(ILayerVisitor&) function is invoked.
92  /// @param layer - pointer to the layer which is calling back to this visit function.
93  /// @param input - Tensor to be provided as the only output of the layer. The layer will maintain
94  /// its own copy of the tensor data, meaning the memory referenced by @a input can
95  /// be freed or reused after this function is called.
96  /// @param name - Optional name for the layer.
97  virtual void VisitConstantLayer(const IConnectableLayer* layer,
98  const ConstTensor& input,
99  const char* name = nullptr) = 0;
100 
101  /// Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&)
102  /// function is invoked.
103  /// @param layer - pointer to the layer which is calling back to this visit function.
104  /// @param convolution2dDescriptor - Description of the 2D convolution layer.
105  /// @param weights - Tensor for the weights data.
106  /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
107  /// @param name - Optional name for the layer.
108  virtual void VisitConvolution2dLayer(const IConnectableLayer* layer,
109  const Convolution2dDescriptor& convolution2dDescriptor,
110  const ConstTensor& weights,
111  const Optional<ConstTensor>& biases,
112  const char* name = nullptr) = 0;
113 
114  /// Function a depth to space layer should call back to when its Accept(ILayerVisitor&) function is invoked.
115  /// @param layer - pointer to the layer which is calling back to this visit function.
116  /// @param depthToSpaceDescriptor - Parameters for the depth to space operation.
117  /// @param name - Optional name for the layer.
118  virtual void VisitDepthToSpaceLayer(const IConnectableLayer* layer,
119  const DepthToSpaceDescriptor& depthToSpaceDescriptor,
120  const char* name = nullptr) = 0;
121 
122  /// Function that a 2D depthwise convolution layer with biases should call back to when its
123  /// Accept(ILayerVisitor&) function is invoked.
124  /// @param layer - pointer to the layer which is calling back to this visit function.
125  /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer.
126  /// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width].
127  /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
128  /// @param name - Optional name for the layer.
129  virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer,
130  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
131  const ConstTensor& weights,
132  const Optional<ConstTensor>& biases,
133  const char* name = nullptr) = 0;
134 
135  /// Function that a Dequantize layer should call back to when its
136  /// Accept(ILayerVisitor&) function is invoked.
137  /// @param layer - pointer to the layer which is calling back to this visit function.
138  /// @param name - Optional name for the layer.
139  virtual void VisitDequantizeLayer(const IConnectableLayer* layer,
140  const char* name = nullptr) = 0;
141 
142  /// Function that a Detection PostProcess layer should call back to when its
143  /// Accept(ILayerVisitor&) function is invoked.
144  /// @param layer - pointer to the layer which is calling back to this visit function.
145  /// @param descriptor - Description of the Detection PostProcess layer.
146  /// @param anchors - Tensor for the anchors.
147  /// @param name - Optional name for the layer.
148  virtual void VisitDetectionPostProcessLayer(const IConnectableLayer* layer,
149  const DetectionPostProcessDescriptor& descriptor,
150  const ConstTensor& anchors,
151  const char* name = nullptr) = 0;
152 
153  /// Function a division layer should call back to when its Accept(ILayerVisitor&) function is invoked.
154  /// @param layer - pointer to the layer which is calling back to this visit function.
155  /// @param name - Optional name for the layer.
156  virtual void VisitDivisionLayer(const IConnectableLayer* layer,
157  const char* name = nullptr) = 0;
158 
159  /// Function a ElementwiseUnary layer should call back to when its Accept(ILayerVisitor&) function is invoked.
160  /// @param layer - pointer to the layer which is calling back to this visit function.
161  /// @param elementwiseUnaryDescriptor - Description of the layer.
162  /// @param name - Optional name for the layer.
163  virtual void VisitElementwiseUnaryLayer(const IConnectableLayer* layer,
164  const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
165  const char* name = nullptr) = 0;
166 
167  /// Function a fill layer should call back to when its Accept(ILayerVisitor&) function is invoked.
168  /// @param layer - pointer to the layer which is calling back to this visit function.
169  /// @param fillDescriptor - Description of the layer
170  /// @param name - Optional name for the layer.
171  virtual void VisitFillLayer(const IConnectableLayer* layer,
172  const FillDescriptor& fillDescriptor,
173  const char* name = nullptr) = 0;
174 
175  /// Function a floor layer should call back to when its Accept(ILayerVisitor&) function is invoked.
176  /// @param layer - pointer to the layer which is calling back to this visit function.
177  /// @param name - Optional name for the layer.
178  virtual void VisitFloorLayer(const IConnectableLayer* layer,
179  const char* name = nullptr) = 0;
180 
181 
182  /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&)
183  /// function is invoked.
184  /// @param layer - pointer to the layer which is calling back to this visit function.
185  /// @param fullyConnectedDescriptor - Description of the fully connected layer.
186  /// @param name - Optional name for the layer.
187  virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
188  const FullyConnectedDescriptor& fullyConnectedDescriptor,
189  const char* name = nullptr) = 0;
190 
191  /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&)
192  /// function is invoked.
193  /// @param layer - pointer to the layer which is calling back to this visit function.
194  /// @param fullyConnectedDescriptor - Description of the fully connected layer.
195  /// @param weights - Tensor for the weights data.
196  /// @param biases - Optional tensor for the bias data.
197  /// @param name - Optional name for the layer.
198  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use VisitFullyConnectedLayer without ConstTensors", "22.05")
199  virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
200  const FullyConnectedDescriptor& fullyConnectedDescriptor,
201  const ConstTensor& weights,
202  const Optional<ConstTensor>& biases,
203  const char* name = nullptr) = 0;
204 
205  /// Function a Gather layer should call back to when its Accept(ILayerVisitor&) function is invoked.
206  /// @param layer - pointer to the layer which is calling back to this visit function.
207  /// @param gatherDescriptor - Parameters for the gather operation.
208  /// @param name - Optional name for the layer.
209  virtual void VisitGatherLayer(const IConnectableLayer* layer,
210  const GatherDescriptor& gatherDescriptor,
211  const char* name = nullptr) = 0;
212 
213  /// Function that an InputLayer should call back to when its Accept(ILayerVisitor&) function is invoked.
214  /// @param layer - pointer to the layer which is calling back to this visit function.
215  /// @param id - User generated id to uniquely identify a particular input. The same id needs to be specified
216  /// when passing the inputs to the IRuntime::EnqueueWorkload() function.
217  /// @param name - Optional name for the layer.
218  virtual void VisitInputLayer(const IConnectableLayer* layer,
219  LayerBindingId id,
220  const char* name = nullptr) = 0;
221 
222  /// Function that an instance normalization layer should call back to when its Accept(ILayerVisitor&)
223  /// function is invoked.
224  /// @param layer - pointer to the layer which is calling back to this visit function.
225  /// @param desc - Parameters for the instance normalization operation.
226  /// @param name - Optional name for the layer.
227  virtual void VisitInstanceNormalizationLayer(const IConnectableLayer* layer,
229  const char* name = nullptr) = 0;
230 
231  /// Function that an L2 normalization layer should call back to when its Accept(ILayerVisitor&)
232  /// function is invoked. Normalization is performed along dimension 1, but requires a 4d input.
233  /// @param layer - pointer to the layer which is calling back to this visit function.
234  /// @param desc - Parameters for the L2 normalization operation.
235  /// @param name - Optional name for the layer.
236  virtual void VisitL2NormalizationLayer(const IConnectableLayer* layer,
237  const L2NormalizationDescriptor& desc,
238  const char* name = nullptr) = 0;
239 
240  /// Function that a log softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked.
241  /// @param layer - pointer to the layer which is calling back to this visit function.
242  /// @param logSoftmaxDescriptor - LogSoftmaxDescriptor to configure the log softmax.
243  /// @param name - Optional name for the layer.
244  virtual void VisitLogSoftmaxLayer(const IConnectableLayer* layer,
245  const LogSoftmaxDescriptor& logSoftmaxDescriptor,
246  const char* name = nullptr) = 0;
247 
248  /// Function that a logical binary layer should call back to when its Accept(ILayerVisitor&) function is invoked.
249  /// @param layer - pointer to the layer which is calling back to this visit function.
250  /// @param logicalBinaryDescriptor - LogicalBinaryDescriptor to configure the logical unary layer.
251  /// @param name - Optional name for the layer.
252  virtual void VisitLogicalBinaryLayer(const IConnectableLayer* layer,
253  const LogicalBinaryDescriptor& logicalBinaryDescriptor,
254  const char* name = nullptr) = 0;
255 
256  /// Function an Lstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
257  /// @param layer - pointer to the layer which is calling back to this visit function.
258  /// @param descriptor - Parameters controlling the operation of the Lstm operation.
259  /// @param params - The weights and biases for the LSTM cell.
260  /// @param name - Optional name for the layer.
261  virtual void VisitLstmLayer(const IConnectableLayer* layer,
262  const LstmDescriptor& descriptor,
263  const LstmInputParams& params,
264  const char* name = nullptr) = 0;
265 
266  /// Function a Maximum layer should call back to when its Accept(ILayerVisitor&) function is invoked.
267  /// @param layer - pointer to the layer which is calling back to this visit function.
268  /// @param name - Optional name for the layer.
269  virtual void VisitMaximumLayer(const IConnectableLayer* layer,
270  const char* name = nullptr) = 0;
271 
272  /// Function a Mean layer should call back to when its Accept(ILayerVisitor&) function is invoked.
273  /// @param layer - pointer to the layer which is calling back to this visit function.
274  /// @param meanDescriptor - Parameters for the mean operation.
275  /// @param name - Optional name for the layer.
276  virtual void VisitMeanLayer(const IConnectableLayer* layer,
277  const MeanDescriptor& meanDescriptor,
278  const char* name = nullptr) = 0;
279 
280  /// Function that a merge layer should call back to when its Accept(ILayerVisitor&) function is invoked.
281  /// @param layer - pointer to the layer which is calling back to this visit function.
282  /// @param name - Optional name for the layer.
283  virtual void VisitMergeLayer(const IConnectableLayer* layer,
284  const char* name = nullptr) = 0;
285 
286  /// Function a Minimum layer should call back to when its Accept(ILayerVisitor&) function is invoked.
287  /// @param layer - pointer to the layer which is calling back to this visit function.
288  /// @param name - Optional name for the layer.
289  virtual void VisitMinimumLayer(const IConnectableLayer* layer,
290  const char* name = nullptr) = 0;
291 
292  /// Function that a multiplication layer should call back to when its Accept(ILayerVisitor&) function is invoked.
293  /// @param layer - pointer to the layer which is calling back to this visit function.
294  /// @param name - Optional name for the layer.
295  virtual void VisitMultiplicationLayer(const IConnectableLayer* layer,
296  const char* name = nullptr) = 0;
297 
298  /// Function that a normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked.
299  /// @param layer - pointer to the layer which is calling back to this visit function.
300  /// @param normalizationDescriptor - NormalizationDescriptor to configure the normalization.
301  /// @param name - Optional name for the layer.
302  virtual void VisitNormalizationLayer(const IConnectableLayer* layer,
303  const NormalizationDescriptor& normalizationDescriptor,
304  const char* name = nullptr) = 0;
305 
306  /// Function an output layer should call back to when its Accept(ILayerVisitor&) function is invoked.
307  /// @param layer - pointer to the layer which is calling back to this visit function.
308  /// @param id - User generated id to uniquely identify a particular output. The same id needs to be specified
309  /// when passing the outputs to the IRuntime::EnqueueWorkload() function.
310  /// @param name - Optional name for the layer.
311  virtual void VisitOutputLayer(const IConnectableLayer* layer,
312  LayerBindingId id,
313  const char* name = nullptr) = 0;
314 
315  /// Function a pad layer should call back to when its Accept(ILayerVisitor&) function is invoked.
316  /// @param layer - pointer to the layer which is calling back to this visit function.
317  /// @param paddings - n by 2 tensor, where n is the rank of the input tensor,
318  /// such that paddings[i,0] indicates the amount of padding to add in front of dimension i, and
319  /// paddings[i,1] indicates the amount of padding to add after the end of dimension i
320  /// @param name - Optional name for the layer.
321  virtual void VisitPadLayer(const IConnectableLayer* layer,
322  const PadDescriptor& padDescriptor,
323  const char* name = nullptr) = 0;
324 
325  /// Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked.
326  /// @param layer - pointer to the layer which is calling back to this visit function.
327  /// @param permuteDescriptor - PermuteDescriptor to configure the permute.
328  /// @param name - Optional name for the layer.
329  virtual void VisitPermuteLayer(const IConnectableLayer* layer,
330  const PermuteDescriptor& permuteDescriptor,
331  const char* name = nullptr) = 0;
332 
333  /// Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked.
334  /// @param layer - pointer to the layer which is calling back to this visit function.
335  /// @param pooling2dDescriptor - Pooling2dDescriptor to configure the pooling.
336  /// @param name - Optional name for the layer.
337  virtual void VisitPooling2dLayer(const IConnectableLayer* layer,
338  const Pooling2dDescriptor& pooling2dDescriptor,
339  const char* name = nullptr) = 0;
340 
341  /// Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked.
342  /// @param layer - pointer to the layer which is calling back to this visit function.
343  /// @param pooling3dDescriptor - Pooling3dDescriptor to configure the pooling.
344  /// @param name - Optional name for the layer.
345  virtual void VisitPooling3dLayer(const IConnectableLayer* layer,
346  const Pooling3dDescriptor& pooling3dDescriptor,
347  const char* name = nullptr) = 0;
348 
349  /// Function that a PReLU activation layer should call back to when its Accept(ILayerVisitor&) function is invoked.
350  /// @param layer - pointer to the layer which is calling back to this visit function.
351  /// @param name - Optional name for the layer.
352  virtual void VisitPreluLayer(const IConnectableLayer* layer,
353  const char* name = nullptr) = 0;
354 
355  /// Function a quantize layer should call back to when its Accept(ILayerVisitor&) function is invoked.
356  /// @param layer - pointer to the layer which is calling back to this visit function.
357  /// @param name - Optional name for the layer.
358  virtual void VisitQuantizeLayer(const IConnectableLayer* layer,
359  const char* name = nullptr) = 0;
360 
361  /// Function a QLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
362  /// @param layer - pointer to the layer which is calling back to this visit function.
363  /// @param descriptor - Parameters controlling the operation of the QLstm operation.
364  /// @param params - The weights and biases for the layer
365  /// @param name - Optional name for the layer.
366  virtual void VisitQLstmLayer(const IConnectableLayer* layer,
367  const QLstmDescriptor& descriptor,
368  const LstmInputParams& params,
369  const char* name = nullptr) = 0;
370 
371  /// Function a QuantizedLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
372  /// @param layer - pointer to the layer which is calling back to this visit function.
373  /// @param params - The weights and biases for the Quantized LSTM cell
374  /// @param name - Optional name for the layer.
375  virtual void VisitQuantizedLstmLayer(const IConnectableLayer* layer,
376  const QuantizedLstmInputParams& params,
377  const char* name = nullptr) = 0;
378 
379  /// Function a rank layer should call back to when its Accept(ILayerVisitor&) function is invoked.
380  /// @param layer - pointer to the layer which is calling back to this visit function.
381  /// @param name - Optional name for the layer.
382  virtual void VisitRankLayer(const IConnectableLayer* layer,
383  const char* name = nullptr) = 0;
384 
385  /// Function that a reduce layer should call back to when its Accept(ILayerVisitor&) function is invoked.
386  /// @param layer - pointer to the layer which is calling back to this visit function.
387  /// @param ReduceDescriptor - Parameters for the reduce max operation.
388  /// @param name - Optional name for the layer.
389  virtual void VisitReduceLayer(const IConnectableLayer* layer,
390  const ReduceDescriptor& reduceDescriptor,
391  const char* name = nullptr) = 0;
392 
393  /// Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked.
394  /// @param layer - pointer to the layer which is calling back to this visit function.
395  /// @param reshapeDescriptor - Parameters for the reshape operation.
396  /// @param name - Optional name for the layer.
397  virtual void VisitReshapeLayer(const IConnectableLayer* layer,
398  const ReshapeDescriptor& reshapeDescriptor,
399  const char* name = nullptr) = 0;
400 
401  /// Function that a resize layer should call back to when its Accept(ILayerVisitor&) function is invoked.
402  /// @param layer - pointer to the layer which is calling back to this visit function.
403  /// @param resizeDescriptor - Parameters for the resize operation.
404  /// @param name - Optional name for the layer.
405  virtual void VisitResizeLayer(const IConnectableLayer* layer,
406  const ResizeDescriptor& resizeDescriptor,
407  const char* name = nullptr) = 0;
408 
409  /// Function that a slice layer should call back to when its Accept(ILayerVisitor&) function is invoked.
410  /// @param layer - pointer to the layer which is calling back to this visit function.
411  /// @param sliceDescriptor - SliceDescriptor to configure the slice operation.
412  /// @param name - Optional name for the layer.
413  virtual void VisitSliceLayer(const IConnectableLayer* layer,
414  const SliceDescriptor& sliceDescriptor,
415  const char* name = nullptr) = 0;
416 
417 
418  /// Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked.
419  /// @param layer - pointer to the layer which is calling back to this visit function.
420  /// @param softmaxDescriptor - SoftmaxDescriptor to configure the softmax.
421  /// @param name - Optional name for the layer.
422  virtual void VisitSoftmaxLayer(const IConnectableLayer* layer,
423  const SoftmaxDescriptor& softmaxDescriptor,
424  const char* name = nullptr) = 0;
425 
426  /// Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invoked.
427  /// @param layer - pointer to the layer which is calling back to this visit function.
428  /// @param spaceToBatchNdDescriptor - Parameters for the space to batch operation.
429  /// @param name - Optional name for the layer.
430  virtual void VisitSpaceToBatchNdLayer(const IConnectableLayer* layer,
431  const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
432  const char* name = nullptr) = 0;
433 
434  /// Function a space to depth layer should call back to when its Accept(ILayerVisitor&) function is invoked.
435  /// @param layer - pointer to the layer which is calling back to this visit function.
436  /// @param spaceToDepthDescriptor - Parameters for the space to depth operation.
437  /// @param name - Optional name for the layer.
438  virtual void VisitSpaceToDepthLayer(const IConnectableLayer* layer,
439  const SpaceToDepthDescriptor& spaceToDepthDescriptor,
440  const char* name = nullptr) = 0;
441 
442  /// Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoked.
443  /// @param layer - pointer to the layer which is calling back to this visit function.
444  /// @param splitterDescriptor - ViewsDescriptor to configure the splitting process.
445  /// Number of Views must be equal to the number of outputs,
446  /// and their order must match - e.g. first view corresponds to
447  /// the first output, second view to the second output, etc....
448  /// @param name - Optional name for the layer.
449  virtual void VisitSplitterLayer(const IConnectableLayer* layer,
450  const ViewsDescriptor& splitterDescriptor,
451  const char* name = nullptr) = 0;
452 
453  /// Function a stack layer should call back to when its Accept(ILayerVisitor&) function is invoked.
454  /// @param layer - pointer to the layer which is calling back to this visit function.
455  /// @param stackDescriptor - Parameters for the stack operation.
456  /// @param name - Optional name for the layer.
457  virtual void VisitStackLayer(const IConnectableLayer* layer,
458  const StackDescriptor& stackDescriptor,
459  const char* name = nullptr) = 0;
460 
461  /// Function a StandInLayer should call back to when its Accept(ILaterVisitor&) function is invoked
462  /// @param layer - pointer to the layer which is calling back to this visit function.
463  /// @param standInDescriptor - Parameters for the stand-in layer.
464  /// @param name - Optional name for the layer.
465  virtual void VisitStandInLayer(const IConnectableLayer* layer,
466  const StandInDescriptor& standInDescriptor,
467  const char* name = nullptr) = 0;
468 
469  /// Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoked.
470  /// @param layer - pointer to the layer which is calling back to this visit function.
471  /// @param stridedSliceDescriptor - Parameters for the strided slice operation.
472  /// @param name - Optional name for the layer.
473  virtual void VisitStridedSliceLayer(const IConnectableLayer* layer,
474  const StridedSliceDescriptor& stridedSliceDescriptor,
475  const char* name = nullptr) = 0;
476 
477  /// Function a subtraction layer should call back to when its Accept(ILayerVisitor&) function is invoked.
478  /// @param layer - pointer to the layer which is calling back to this visit function.
479  /// @param name - Optional name for the layer.
480  virtual void VisitSubtractionLayer(const IConnectableLayer* layer,
481  const char* name = nullptr) = 0;
482 
483  /// Function a switch layer should call back to when its Accept(ILayerVisitor&) function is invoked.
484  /// @param layer - pointer to the layer which is calling back to this visit function.
485  /// @param name - Optional name for the layer.
486  virtual void VisitSwitchLayer(const IConnectableLayer* layer,
487  const char* name = nullptr) = 0;
488 
489  /// Function that a 2D transpose convolution layer should call back to when its Accept(ILayerVisitor&)
490  /// function is invoked.
491  /// @param layer - pointer to the layer which is calling back to this visit function.
492  /// @param descriptor - Description of the 2D transpose convolution layer.
493  /// @param weights - Tensor for the weights data.
494  /// @param biases - Optional tensor for the bias data.
495  /// @param name - Optional name for the layer.
496  virtual void VisitTransposeConvolution2dLayer(const IConnectableLayer* layer,
497  const TransposeConvolution2dDescriptor& descriptor,
498  const ConstTensor& weights,
499  const Optional<ConstTensor>& biases,
500  const char* name = nullptr) = 0;
501 
502  /// Function that a transpose layer should call back to when its Accept(ILayerVisitor&) function is invoked.
503  /// @param layer - pointer to the layer which is calling back to this visit function.
504  /// @param transposeDescriptor - TransposeDescriptor to configure the transpose.
505  /// @param name - Optional name for the layer.
506  virtual void VisitTransposeLayer(const IConnectableLayer* layer,
507  const TransposeDescriptor& transposeDescriptor,
508  const char* name = nullptr) = 0;
509 
510  virtual void StartVisit() {}
511  virtual void FinishVisit() {}
512 
513 };
514 } // namespace armnn
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:66
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
A ReshapeDescriptor for the ReshapeLayer.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
A Convolution2dDescriptor for the Convolution2dLayer.
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
Copyright (c) 2021 ARM Limited and Contributors.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:277
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
A StackDescriptor for the StackLayer.
A PadDescriptor for the PadLayer.
An LstmDescriptor for the LstmLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:327
A GatherDescriptor for the GatherLayer.
ARMNN_NO_DEPRECATE_WARN_BEGIN struct ARMNN_DEPRECATED_MSG_REMOVAL_DATE("ResizeBilinearQueueDescriptor is deprecated use ResizeQueueDescriptor instead", "22.08") ResizeBilinearQueueDescriptor
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
A SliceDescriptor for the SliceLayer.
A Pooling3dDescriptor for the Pooling3dLayer.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
A MeanDescriptor for the MeanLayer.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.