ArmNN
 22.05
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 name - Optional name for the layer.
106  virtual void VisitConvolution2dLayer(const IConnectableLayer* layer,
107  const Convolution2dDescriptor& convolution2dDescriptor,
108  const char* name = nullptr) = 0;
109 
110  /// Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&)
111  /// function is invoked.
112  /// @param layer - pointer to the layer which is calling back to this visit function.
113  /// @param convolution2dDescriptor - Description of the 2D convolution layer.
114  /// @param weights - Tensor for the weights data.
115  /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
116  /// @param name - Optional name for the layer.
117  ARMNN_DEPRECATED_MSG("Use VisitConvolution2dLayer without ConstTensors")
118  virtual void VisitConvolution2dLayer(const IConnectableLayer* layer,
119  const Convolution2dDescriptor& convolution2dDescriptor,
120  const ConstTensor& weights,
121  const Optional<ConstTensor>& biases,
122  const char* name = nullptr) = 0;
123 
124  /// Function a depth to space layer should call back to when its Accept(ILayerVisitor&) function is invoked.
125  /// @param layer - pointer to the layer which is calling back to this visit function.
126  /// @param depthToSpaceDescriptor - Parameters for the depth to space operation.
127  /// @param name - Optional name for the layer.
128  virtual void VisitDepthToSpaceLayer(const IConnectableLayer* layer,
129  const DepthToSpaceDescriptor& depthToSpaceDescriptor,
130  const char* name = nullptr) = 0;
131 
132  /// Function that a 2D depthwise convolution layer with biases should call back to when its
133  /// Accept(ILayerVisitor&) function is invoked.
134  /// @param layer - pointer to the layer which is calling back to this visit function.
135  /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer.
136  /// @param name - Optional name for the layer.
137  virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer,
138  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
139  const char* name = nullptr) = 0;
140 
141  /// Function that a 2D depthwise convolution layer with biases should call back to when its
142  /// Accept(ILayerVisitor&) function is invoked.
143  /// @param layer - pointer to the layer which is calling back to this visit function.
144  /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer.
145  /// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width].
146  /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
147  /// @param name - Optional name for the layer.
148  ARMNN_DEPRECATED_MSG("Use VisitDepthwiseConvolution2dLayer without ConstTensors")
149  virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer,
150  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
151  const ConstTensor& weights,
152  const Optional<ConstTensor>& biases,
153  const char* name = nullptr) = 0;
154 
155  /// Function that a Dequantize layer should call back to when its
156  /// Accept(ILayerVisitor&) function is invoked.
157  /// @param layer - pointer to the layer which is calling back to this visit function.
158  /// @param name - Optional name for the layer.
159  virtual void VisitDequantizeLayer(const IConnectableLayer* layer,
160  const char* name = nullptr) = 0;
161 
162  /// Function that a Detection PostProcess layer should call back to when its
163  /// Accept(ILayerVisitor&) function is invoked.
164  /// @param layer - pointer to the layer which is calling back to this visit function.
165  /// @param descriptor - Description of the Detection PostProcess layer.
166  /// @param anchors - Tensor for the anchors.
167  /// @param name - Optional name for the layer.
168  virtual void VisitDetectionPostProcessLayer(const IConnectableLayer* layer,
169  const DetectionPostProcessDescriptor& descriptor,
170  const ConstTensor& anchors,
171  const char* name = nullptr) = 0;
172 
173  /// Function a division layer should call back to when its Accept(ILayerVisitor&) function is invoked.
174  /// @param layer - pointer to the layer which is calling back to this visit function.
175  /// @param name - Optional name for the layer.
176  virtual void VisitDivisionLayer(const IConnectableLayer* layer,
177  const char* name = nullptr) = 0;
178 
179  /// Function a ElementwiseUnary layer should call back to when its Accept(ILayerVisitor&) function is invoked.
180  /// @param layer - pointer to the layer which is calling back to this visit function.
181  /// @param elementwiseUnaryDescriptor - Description of the layer.
182  /// @param name - Optional name for the layer.
183  virtual void VisitElementwiseUnaryLayer(const IConnectableLayer* layer,
184  const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
185  const char* name = nullptr) = 0;
186 
187  /// Function a fill layer should call back to when its Accept(ILayerVisitor&) function is invoked.
188  /// @param layer - pointer to the layer which is calling back to this visit function.
189  /// @param fillDescriptor - Description of the layer
190  /// @param name - Optional name for the layer.
191  virtual void VisitFillLayer(const IConnectableLayer* layer,
192  const FillDescriptor& fillDescriptor,
193  const char* name = nullptr) = 0;
194 
195  /// Function a floor layer should call back to when its Accept(ILayerVisitor&) function is invoked.
196  /// @param layer - pointer to the layer which is calling back to this visit function.
197  /// @param name - Optional name for the layer.
198  virtual void VisitFloorLayer(const IConnectableLayer* layer,
199  const char* name = nullptr) = 0;
200 
201 
202  /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&)
203  /// function is invoked.
204  /// @param layer - pointer to the layer which is calling back to this visit function.
205  /// @param fullyConnectedDescriptor - Description of the fully connected layer.
206  /// @param name - Optional name for the layer.
207  virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
208  const FullyConnectedDescriptor& fullyConnectedDescriptor,
209  const char* name = nullptr) = 0;
210 
211  /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&)
212  /// function is invoked.
213  /// @param layer - pointer to the layer which is calling back to this visit function.
214  /// @param fullyConnectedDescriptor - Description of the fully connected layer.
215  /// @param weights - Tensor for the weights data.
216  /// @param biases - Optional tensor for the bias data.
217  /// @param name - Optional name for the layer.
218  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use VisitFullyConnectedLayer without ConstTensors", "22.05")
219  virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
220  const FullyConnectedDescriptor& fullyConnectedDescriptor,
221  const ConstTensor& weights,
222  const Optional<ConstTensor>& biases,
223  const char* name = nullptr) = 0;
224 
225  /// Function a Gather layer should call back to when its Accept(ILayerVisitor&) function is invoked.
226  /// @param layer - pointer to the layer which is calling back to this visit function.
227  /// @param gatherDescriptor - Parameters for the gather operation.
228  /// @param name - Optional name for the layer.
229  virtual void VisitGatherLayer(const IConnectableLayer* layer,
230  const GatherDescriptor& gatherDescriptor,
231  const char* name = nullptr) = 0;
232 
233  /// Function that an InputLayer should call back to when its Accept(ILayerVisitor&) function is invoked.
234  /// @param layer - pointer to the layer which is calling back to this visit function.
235  /// @param id - User generated id to uniquely identify a particular input. The same id needs to be specified
236  /// when passing the inputs to the IRuntime::EnqueueWorkload() function.
237  /// @param name - Optional name for the layer.
238  virtual void VisitInputLayer(const IConnectableLayer* layer,
239  LayerBindingId id,
240  const char* name = nullptr) = 0;
241 
242  /// Function that an instance normalization layer should call back to when its Accept(ILayerVisitor&)
243  /// function is invoked.
244  /// @param layer - pointer to the layer which is calling back to this visit function.
245  /// @param desc - Parameters for the instance normalization operation.
246  /// @param name - Optional name for the layer.
247  virtual void VisitInstanceNormalizationLayer(const IConnectableLayer* layer,
249  const char* name = nullptr) = 0;
250 
251  /// Function that an L2 normalization layer should call back to when its Accept(ILayerVisitor&)
252  /// function is invoked. Normalization is performed along dimension 1, but requires a 4d input.
253  /// @param layer - pointer to the layer which is calling back to this visit function.
254  /// @param desc - Parameters for the L2 normalization operation.
255  /// @param name - Optional name for the layer.
256  virtual void VisitL2NormalizationLayer(const IConnectableLayer* layer,
257  const L2NormalizationDescriptor& desc,
258  const char* name = nullptr) = 0;
259 
260  /// Function that a log softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked.
261  /// @param layer - pointer to the layer which is calling back to this visit function.
262  /// @param logSoftmaxDescriptor - LogSoftmaxDescriptor to configure the log softmax.
263  /// @param name - Optional name for the layer.
264  virtual void VisitLogSoftmaxLayer(const IConnectableLayer* layer,
265  const LogSoftmaxDescriptor& logSoftmaxDescriptor,
266  const char* name = nullptr) = 0;
267 
268  /// Function that a logical binary layer should call back to when its Accept(ILayerVisitor&) function is invoked.
269  /// @param layer - pointer to the layer which is calling back to this visit function.
270  /// @param logicalBinaryDescriptor - LogicalBinaryDescriptor to configure the logical unary layer.
271  /// @param name - Optional name for the layer.
272  virtual void VisitLogicalBinaryLayer(const IConnectableLayer* layer,
273  const LogicalBinaryDescriptor& logicalBinaryDescriptor,
274  const char* name = nullptr) = 0;
275 
276  /// Function an Lstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
277  /// @param layer - pointer to the layer which is calling back to this visit function.
278  /// @param descriptor - Parameters controlling the operation of the Lstm operation.
279  /// @param params - The weights and biases for the LSTM cell.
280  /// @param name - Optional name for the layer.
281  virtual void VisitLstmLayer(const IConnectableLayer* layer,
282  const LstmDescriptor& descriptor,
283  const LstmInputParams& params,
284  const char* name = nullptr) = 0;
285 
286  /// Function a Maximum 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 VisitMaximumLayer(const IConnectableLayer* layer,
290  const char* name = nullptr) = 0;
291 
292  /// Function a Mean 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 meanDescriptor - Parameters for the mean operation.
295  /// @param name - Optional name for the layer.
296  virtual void VisitMeanLayer(const IConnectableLayer* layer,
297  const MeanDescriptor& meanDescriptor,
298  const char* name = nullptr) = 0;
299 
300  /// Function that a merge layer should call back to when its Accept(ILayerVisitor&) function is invoked.
301  /// @param layer - pointer to the layer which is calling back to this visit function.
302  /// @param name - Optional name for the layer.
303  virtual void VisitMergeLayer(const IConnectableLayer* layer,
304  const char* name = nullptr) = 0;
305 
306  /// Function a Minimum 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 name - Optional name for the layer.
309  virtual void VisitMinimumLayer(const IConnectableLayer* layer,
310  const char* name = nullptr) = 0;
311 
312  /// Function that a multiplication layer should call back to when its Accept(ILayerVisitor&) function is invoked.
313  /// @param layer - pointer to the layer which is calling back to this visit function.
314  /// @param name - Optional name for the layer.
315  virtual void VisitMultiplicationLayer(const IConnectableLayer* layer,
316  const char* name = nullptr) = 0;
317 
318  /// Function that a normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked.
319  /// @param layer - pointer to the layer which is calling back to this visit function.
320  /// @param normalizationDescriptor - NormalizationDescriptor to configure the normalization.
321  /// @param name - Optional name for the layer.
322  virtual void VisitNormalizationLayer(const IConnectableLayer* layer,
323  const NormalizationDescriptor& normalizationDescriptor,
324  const char* name = nullptr) = 0;
325 
326  /// Function an output layer should call back to when its Accept(ILayerVisitor&) function is invoked.
327  /// @param layer - pointer to the layer which is calling back to this visit function.
328  /// @param id - User generated id to uniquely identify a particular output. The same id needs to be specified
329  /// when passing the outputs to the IRuntime::EnqueueWorkload() function.
330  /// @param name - Optional name for the layer.
331  virtual void VisitOutputLayer(const IConnectableLayer* layer,
332  LayerBindingId id,
333  const char* name = nullptr) = 0;
334 
335  /// Function a pad layer should call back to when its Accept(ILayerVisitor&) function is invoked.
336  /// @param layer - pointer to the layer which is calling back to this visit function.
337  /// @param paddings - n by 2 tensor, where n is the rank of the input tensor,
338  /// such that paddings[i,0] indicates the amount of padding to add in front of dimension i, and
339  /// paddings[i,1] indicates the amount of padding to add after the end of dimension i
340  /// @param name - Optional name for the layer.
341  virtual void VisitPadLayer(const IConnectableLayer* layer,
342  const PadDescriptor& padDescriptor,
343  const char* name = nullptr) = 0;
344 
345  /// Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked.
346  /// @param layer - pointer to the layer which is calling back to this visit function.
347  /// @param permuteDescriptor - PermuteDescriptor to configure the permute.
348  /// @param name - Optional name for the layer.
349  virtual void VisitPermuteLayer(const IConnectableLayer* layer,
350  const PermuteDescriptor& permuteDescriptor,
351  const char* name = nullptr) = 0;
352 
353  /// Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked.
354  /// @param layer - pointer to the layer which is calling back to this visit function.
355  /// @param pooling2dDescriptor - Pooling2dDescriptor to configure the pooling.
356  /// @param name - Optional name for the layer.
357  virtual void VisitPooling2dLayer(const IConnectableLayer* layer,
358  const Pooling2dDescriptor& pooling2dDescriptor,
359  const char* name = nullptr) = 0;
360 
361  /// Function that a pooling 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 pooling3dDescriptor - Pooling3dDescriptor to configure the pooling.
364  /// @param name - Optional name for the layer.
365  virtual void VisitPooling3dLayer(const IConnectableLayer* layer,
366  const Pooling3dDescriptor& pooling3dDescriptor,
367  const char* name = nullptr) = 0;
368 
369  /// Function that a PReLU activation layer should call back to when its Accept(ILayerVisitor&) function is invoked.
370  /// @param layer - pointer to the layer which is calling back to this visit function.
371  /// @param name - Optional name for the layer.
372  virtual void VisitPreluLayer(const IConnectableLayer* layer,
373  const char* name = nullptr) = 0;
374 
375  /// Function a quantize layer should call back to when its Accept(ILayerVisitor&) function is invoked.
376  /// @param layer - pointer to the layer which is calling back to this visit function.
377  /// @param name - Optional name for the layer.
378  virtual void VisitQuantizeLayer(const IConnectableLayer* layer,
379  const char* name = nullptr) = 0;
380 
381  /// Function a QLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
382  /// @param layer - pointer to the layer which is calling back to this visit function.
383  /// @param descriptor - Parameters controlling the operation of the QLstm operation.
384  /// @param params - The weights and biases for the layer
385  /// @param name - Optional name for the layer.
386  virtual void VisitQLstmLayer(const IConnectableLayer* layer,
387  const QLstmDescriptor& descriptor,
388  const LstmInputParams& params,
389  const char* name = nullptr) = 0;
390 
391  /// Function a QuantizedLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
392  /// @param layer - pointer to the layer which is calling back to this visit function.
393  /// @param params - The weights and biases for the Quantized LSTM cell
394  /// @param name - Optional name for the layer.
395  virtual void VisitQuantizedLstmLayer(const IConnectableLayer* layer,
396  const QuantizedLstmInputParams& params,
397  const char* name = nullptr) = 0;
398 
399  /// Function a rank layer should call back to when its Accept(ILayerVisitor&) function is invoked.
400  /// @param layer - pointer to the layer which is calling back to this visit function.
401  /// @param name - Optional name for the layer.
402  virtual void VisitRankLayer(const IConnectableLayer* layer,
403  const char* name = nullptr) = 0;
404 
405  /// Function that a reduce layer should call back to when its Accept(ILayerVisitor&) function is invoked.
406  /// @param layer - pointer to the layer which is calling back to this visit function.
407  /// @param ReduceDescriptor - Parameters for the reduce max operation.
408  /// @param name - Optional name for the layer.
409  virtual void VisitReduceLayer(const IConnectableLayer* layer,
410  const ReduceDescriptor& reduceDescriptor,
411  const char* name = nullptr) = 0;
412 
413  /// Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked.
414  /// @param layer - pointer to the layer which is calling back to this visit function.
415  /// @param reshapeDescriptor - Parameters for the reshape operation.
416  /// @param name - Optional name for the layer.
417  virtual void VisitReshapeLayer(const IConnectableLayer* layer,
418  const ReshapeDescriptor& reshapeDescriptor,
419  const char* name = nullptr) = 0;
420 
421  /// Function that a resize layer should call back to when its Accept(ILayerVisitor&) function is invoked.
422  /// @param layer - pointer to the layer which is calling back to this visit function.
423  /// @param resizeDescriptor - Parameters for the resize operation.
424  /// @param name - Optional name for the layer.
425  virtual void VisitResizeLayer(const IConnectableLayer* layer,
426  const ResizeDescriptor& resizeDescriptor,
427  const char* name = nullptr) = 0;
428 
429  /// Function that a slice layer should call back to when its Accept(ILayerVisitor&) function is invoked.
430  /// @param layer - pointer to the layer which is calling back to this visit function.
431  /// @param sliceDescriptor - SliceDescriptor to configure the slice operation.
432  /// @param name - Optional name for the layer.
433  virtual void VisitSliceLayer(const IConnectableLayer* layer,
434  const SliceDescriptor& sliceDescriptor,
435  const char* name = nullptr) = 0;
436 
437 
438  /// Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked.
439  /// @param layer - pointer to the layer which is calling back to this visit function.
440  /// @param softmaxDescriptor - SoftmaxDescriptor to configure the softmax.
441  /// @param name - Optional name for the layer.
442  virtual void VisitSoftmaxLayer(const IConnectableLayer* layer,
443  const SoftmaxDescriptor& softmaxDescriptor,
444  const char* name = nullptr) = 0;
445 
446  /// Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invoked.
447  /// @param layer - pointer to the layer which is calling back to this visit function.
448  /// @param spaceToBatchNdDescriptor - Parameters for the space to batch operation.
449  /// @param name - Optional name for the layer.
450  virtual void VisitSpaceToBatchNdLayer(const IConnectableLayer* layer,
451  const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
452  const char* name = nullptr) = 0;
453 
454  /// Function a space to depth layer should call back to when its Accept(ILayerVisitor&) function is invoked.
455  /// @param layer - pointer to the layer which is calling back to this visit function.
456  /// @param spaceToDepthDescriptor - Parameters for the space to depth operation.
457  /// @param name - Optional name for the layer.
458  virtual void VisitSpaceToDepthLayer(const IConnectableLayer* layer,
459  const SpaceToDepthDescriptor& spaceToDepthDescriptor,
460  const char* name = nullptr) = 0;
461 
462  /// Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoked.
463  /// @param layer - pointer to the layer which is calling back to this visit function.
464  /// @param splitterDescriptor - ViewsDescriptor to configure the splitting process.
465  /// Number of Views must be equal to the number of outputs,
466  /// and their order must match - e.g. first view corresponds to
467  /// the first output, second view to the second output, etc....
468  /// @param name - Optional name for the layer.
469  virtual void VisitSplitterLayer(const IConnectableLayer* layer,
470  const ViewsDescriptor& splitterDescriptor,
471  const char* name = nullptr) = 0;
472 
473  /// Function a stack layer should call back to when its Accept(ILayerVisitor&) function is invoked.
474  /// @param layer - pointer to the layer which is calling back to this visit function.
475  /// @param stackDescriptor - Parameters for the stack operation.
476  /// @param name - Optional name for the layer.
477  virtual void VisitStackLayer(const IConnectableLayer* layer,
478  const StackDescriptor& stackDescriptor,
479  const char* name = nullptr) = 0;
480 
481  /// Function a StandInLayer should call back to when its Accept(ILaterVisitor&) function is invoked
482  /// @param layer - pointer to the layer which is calling back to this visit function.
483  /// @param standInDescriptor - Parameters for the stand-in layer.
484  /// @param name - Optional name for the layer.
485  virtual void VisitStandInLayer(const IConnectableLayer* layer,
486  const StandInDescriptor& standInDescriptor,
487  const char* name = nullptr) = 0;
488 
489  /// Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoked.
490  /// @param layer - pointer to the layer which is calling back to this visit function.
491  /// @param stridedSliceDescriptor - Parameters for the strided slice operation.
492  /// @param name - Optional name for the layer.
493  virtual void VisitStridedSliceLayer(const IConnectableLayer* layer,
494  const StridedSliceDescriptor& stridedSliceDescriptor,
495  const char* name = nullptr) = 0;
496 
497  /// Function a subtraction layer should call back to when its Accept(ILayerVisitor&) function is invoked.
498  /// @param layer - pointer to the layer which is calling back to this visit function.
499  /// @param name - Optional name for the layer.
500  virtual void VisitSubtractionLayer(const IConnectableLayer* layer,
501  const char* name = nullptr) = 0;
502 
503  /// Function a switch layer should call back to when its Accept(ILayerVisitor&) function is invoked.
504  /// @param layer - pointer to the layer which is calling back to this visit function.
505  /// @param name - Optional name for the layer.
506  virtual void VisitSwitchLayer(const IConnectableLayer* layer,
507  const char* name = nullptr) = 0;
508 
509  /// Function that a 2D transpose convolution layer should call back to when its Accept(ILayerVisitor&)
510  /// function is invoked.
511  /// @param layer - pointer to the layer which is calling back to this visit function.
512  /// @param descriptor - Description of the 2D transpose convolution layer.
513  /// @param weights - Tensor for the weights data.
514  /// @param biases - Optional tensor for the bias data.
515  /// @param name - Optional name for the layer.
516  virtual void VisitTransposeConvolution2dLayer(const IConnectableLayer* layer,
517  const TransposeConvolution2dDescriptor& descriptor,
518  const ConstTensor& weights,
519  const Optional<ConstTensor>& biases,
520  const char* name = nullptr) = 0;
521 
522  /// Function that a transpose layer should call back to when its Accept(ILayerVisitor&) function is invoked.
523  /// @param layer - pointer to the layer which is calling back to this visit function.
524  /// @param transposeDescriptor - TransposeDescriptor to configure the transpose.
525  /// @param name - Optional name for the layer.
526  virtual void VisitTransposeLayer(const IConnectableLayer* layer,
527  const TransposeDescriptor& transposeDescriptor,
528  const char* name = nullptr) = 0;
529 
530  virtual void StartVisit() {}
531  virtual void FinishVisit() {}
532 
533 };
534 } // 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:290
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.
#define ARMNN_DEPRECATED_MSG(message)
Definition: Deprecated.hpp:43
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.