ArmNN
 22.05
LayerVisitorBase.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 
6 #pragma once
7 
9 
10 namespace armnn
11 {
12 
14 {
15  static void Apply(const std::string& errorMessage = "") { throw UnimplementedException(errorMessage); }
16 };
17 
19 {
20  static void Apply(const std::string&) {}
21 };
22 
23 /// Visitor base class with empty implementations.
25 template<typename DefaultPolicy>
26 class LayerVisitorBase : public ILayerVisitor
27 {
28 protected:
30  virtual ~LayerVisitorBase() {}
31 
32 public:
33 
35  const ActivationDescriptor&,
36  const char*) override { DefaultPolicy::Apply(__func__); }
37 
39  const char*) override { DefaultPolicy::Apply(__func__); }
40 
42  const ArgMinMaxDescriptor&,
43  const char*) override { DefaultPolicy::Apply(__func__); }
44 
47  const ConstTensor&,
48  const ConstTensor&,
49  const ConstTensor&,
50  const ConstTensor&,
51  const char*) override { DefaultPolicy::Apply(__func__); }
52 
55  const char*) override { DefaultPolicy::Apply(__func__); }
56 
58  const ComparisonDescriptor&,
59  const char*) override { DefaultPolicy::Apply(__func__); }
60 
62  const ConcatDescriptor&,
63  const char*) override { DefaultPolicy::Apply(__func__); }
64 
66  const ConstTensor&,
67  const char*) override { DefaultPolicy::Apply(__func__); }
68 
71  const ConstTensor&,
72  const Optional<ConstTensor>&,
73  const char*) override { DefaultPolicy::Apply(__func__); }
74 
77  const char*) override { DefaultPolicy::Apply(__func__); }
78 
81  const char*) override { DefaultPolicy::Apply(__func__); }
82 
85  const char*) override { DefaultPolicy::Apply(__func__); }
86 
89  const ConstTensor&,
90  const Optional<ConstTensor>&,
91  const char*) override { DefaultPolicy::Apply(__func__); }
92 
94  const char*) override { DefaultPolicy::Apply(__func__); }
95 
98  const ConstTensor&,
99  const char*) override { DefaultPolicy::Apply(__func__); }
100 
102  const char*) override { DefaultPolicy::Apply(__func__); }
103 
106  const char*) override { DefaultPolicy::Apply(__func__); }
107 
109  const FillDescriptor&,
110  const char*) override { DefaultPolicy::Apply(__func__); }
111 
113  const char*) override { DefaultPolicy::Apply(__func__); }
114 
117  const char*) override { DefaultPolicy::Apply(__func__); }
118 
121  const ConstTensor&,
122  const Optional<ConstTensor>&,
123  const char*) override { DefaultPolicy::Apply(__func__); }
124 
126  const GatherDescriptor&,
127  const char*) override { DefaultPolicy::Apply(__func__); }
128 
131  const char*) override { DefaultPolicy::Apply(__func__); }
132 
135  const char*) override { DefaultPolicy::Apply(__func__); }
136 
139  const char*) override { DefaultPolicy::Apply(__func__); }
140 
142  const LogSoftmaxDescriptor&,
143  const char*) override { DefaultPolicy::Apply(__func__); }
144 
147  const char*) override {DefaultPolicy::Apply(__func__); }
148 
150  const LstmDescriptor&,
151  const LstmInputParams&,
152  const char*) override { DefaultPolicy::Apply(__func__); }
153 
155  const char*) override { DefaultPolicy::Apply(__func__); }
156 
158  const MeanDescriptor&,
159  const char*) override { DefaultPolicy::Apply(__func__); }
160 
162  const char*) override { DefaultPolicy::Apply(__func__); }
163 
165  const char*) override { DefaultPolicy::Apply(__func__); }
166 
168  const char*) override { DefaultPolicy::Apply(__func__); }
169 
172  const char*) override { DefaultPolicy::Apply(__func__); }
173 
176  const char*) override { DefaultPolicy::Apply(__func__); }
177 
179  const PadDescriptor&,
180  const char*) override { DefaultPolicy::Apply(__func__); }
181 
183  const PermuteDescriptor&,
184  const char*) override { DefaultPolicy::Apply(__func__); }
185 
187  const Pooling2dDescriptor&,
188  const char*) override { DefaultPolicy::Apply(__func__); }
189 
191  const char*) override { DefaultPolicy::Apply(__func__); }
192 
194  const char*) override { DefaultPolicy::Apply(__func__); }
195 
197  const QLstmDescriptor&,
198  const LstmInputParams&,
199  const char*) override { DefaultPolicy::Apply(__func__); }
200 
203  const char*) override { DefaultPolicy::Apply(__func__); }
204 
206  const char*) override { DefaultPolicy::Apply(__func__); }
207 
209  const ReduceDescriptor&,
210  const char*) override { DefaultPolicy::Apply(__func__); }
211 
213  const ReshapeDescriptor&,
214  const char*) override { DefaultPolicy::Apply(__func__); }
215 
217  const ResizeDescriptor&,
218  const char*) override { DefaultPolicy::Apply(__func__); }
219 
221  const SliceDescriptor&,
222  const char*) override { DefaultPolicy::Apply(__func__); }
223 
225  const SoftmaxDescriptor&,
226  const char*) override { DefaultPolicy::Apply(__func__); }
227 
230  const char*) override { DefaultPolicy::Apply(__func__); }
231 
233  const SpaceToDepthDescriptor&,
234  const char*) override { DefaultPolicy::Apply(__func__); }
235 
237  const ViewsDescriptor&,
238  const char*) override { DefaultPolicy::Apply(__func__); }
239 
241  const StackDescriptor&,
242  const char*) override { DefaultPolicy::Apply(__func__); }
243 
245  const StandInDescriptor&,
246  const char*) override { DefaultPolicy::Apply(__func__); }
247 
249  const StridedSliceDescriptor&,
250  const char*) override { DefaultPolicy::Apply(__func__); }
251 
253  const char*) override { DefaultPolicy::Apply(__func__); }
254 
256  const char*) override { DefaultPolicy::Apply(__func__); }
257 
260  const ConstTensor&,
261  const Optional<ConstTensor>&,
262  const char*) override { DefaultPolicy::Apply(__func__); }
263 
265  const TransposeDescriptor&,
266  const char*) override { DefaultPolicy::Apply(__func__); }
267 
268 };
270 
271 } // namespace armnn
void VisitL2NormalizationLayer(const IConnectableLayer *, const L2NormalizationDescriptor &, const char *) override
void VisitPooling2dLayer(const IConnectableLayer *, const Pooling2dDescriptor &, const char *) override
void VisitMergeLayer(const IConnectableLayer *, const char *) override
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:66
void VisitLogicalBinaryLayer(const IConnectableLayer *, const LogicalBinaryDescriptor &, const char *) override
static void Apply(const std::string &errorMessage="")
void VisitInputLayer(const IConnectableLayer *, LayerBindingId, const char *) override
void VisitPermuteLayer(const IConnectableLayer *, const PermuteDescriptor &, const char *) override
void VisitStridedSliceLayer(const IConnectableLayer *, const StridedSliceDescriptor &, const char *) override
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
void VisitTransposeConvolution2dLayer(const IConnectableLayer *, const TransposeConvolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
void VisitPreluLayer(const IConnectableLayer *, const char *) override
void VisitInstanceNormalizationLayer(const IConnectableLayer *, const InstanceNormalizationDescriptor &, const char *) override
A ReshapeDescriptor for the ReshapeLayer.
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
void VisitDepthwiseConvolution2dLayer(const IConnectableLayer *, const DepthwiseConvolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
void VisitSpaceToDepthLayer(const IConnectableLayer *, const SpaceToDepthDescriptor &, const char *) override
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
void VisitSplitterLayer(const IConnectableLayer *, const ViewsDescriptor &, const char *) override
A Convolution2dDescriptor for the Convolution2dLayer.
void VisitDequantizeLayer(const IConnectableLayer *, const char *) override
void VisitResizeLayer(const IConnectableLayer *, const ResizeDescriptor &, const char *) override
void VisitFullyConnectedLayer(const IConnectableLayer *, const FullyConnectedDescriptor &, const char *) override
void VisitConcatLayer(const IConnectableLayer *, const ConcatDescriptor &, const char *) override
void VisitDepthToSpaceLayer(const IConnectableLayer *, const DepthToSpaceDescriptor &, const char *) override
void VisitQuantizedLstmLayer(const IConnectableLayer *, const QuantizedLstmInputParams &, const char *) override
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
void VisitArgMinMaxLayer(const IConnectableLayer *, const ArgMinMaxDescriptor &, const char *) override
Copyright (c) 2021 ARM Limited and Contributors.
void VisitFullyConnectedLayer(const IConnectableLayer *, const FullyConnectedDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
void VisitConvolution2dLayer(const IConnectableLayer *, const Convolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
void VisitQuantizeLayer(const IConnectableLayer *, const char *) override
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:290
void VisitPadLayer(const IConnectableLayer *, const PadDescriptor &, const char *) override
void VisitBatchNormalizationLayer(const IConnectableLayer *, const BatchNormalizationDescriptor &, const ConstTensor &, const ConstTensor &, const ConstTensor &, const ConstTensor &, const char *) override
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
A StackDescriptor for the StackLayer.
A PadDescriptor for the PadLayer.
static void Apply(const std::string &)
void VisitBatchToSpaceNdLayer(const IConnectableLayer *, const BatchToSpaceNdDescriptor &, const char *) override
An LstmDescriptor for the LstmLayer.
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34
void VisitFillLayer(const IConnectableLayer *, const FillDescriptor &, const char *) override
void VisitQLstmLayer(const IConnectableLayer *, const QLstmDescriptor &, const LstmInputParams &, const char *) override
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.
void VisitMultiplicationLayer(const IConnectableLayer *, const char *) override
void VisitTransposeLayer(const IConnectableLayer *, const TransposeDescriptor &, const char *) override
void VisitConstantLayer(const IConnectableLayer *, const ConstTensor &, const char *) override
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:327
void VisitStackLayer(const IConnectableLayer *, const StackDescriptor &, const char *) override
void VisitSubtractionLayer(const IConnectableLayer *, const char *) override
A GatherDescriptor for the GatherLayer.
void VisitDepthwiseConvolution2dLayer(const IConnectableLayer *, const DepthwiseConvolution2dDescriptor &, const char *) override
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
void VisitLogSoftmaxLayer(const IConnectableLayer *, const LogSoftmaxDescriptor &, const char *) override
void VisitLstmLayer(const IConnectableLayer *, const LstmDescriptor &, const LstmInputParams &, const char *) override
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
A SliceDescriptor for the SliceLayer.
Visitor base class with empty implementations.
void VisitDivisionLayer(const IConnectableLayer *, const char *) override
void VisitSliceLayer(const IConnectableLayer *, const SliceDescriptor &, const char *) override
void VisitStandInLayer(const IConnectableLayer *, const StandInDescriptor &, const char *) override
void VisitDetectionPostProcessLayer(const IConnectableLayer *, const DetectionPostProcessDescriptor &, const ConstTensor &, const char *) override
void VisitMaximumLayer(const IConnectableLayer *, const char *) override
void VisitAdditionLayer(const IConnectableLayer *, const char *) override
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
void VisitSpaceToBatchNdLayer(const IConnectableLayer *, const SpaceToBatchNdDescriptor &, const char *) override
void VisitMinimumLayer(const IConnectableLayer *, const char *) override
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
void VisitMeanLayer(const IConnectableLayer *, const MeanDescriptor &, const char *) override
void VisitSwitchLayer(const IConnectableLayer *, const char *) override
A MeanDescriptor for the MeanLayer.
void VisitOutputLayer(const IConnectableLayer *, LayerBindingId, const char *) override
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
void VisitNormalizationLayer(const IConnectableLayer *, const NormalizationDescriptor &, const char *) override
void VisitFloorLayer(const IConnectableLayer *, const char *) override
void VisitSoftmaxLayer(const IConnectableLayer *, const SoftmaxDescriptor &, const char *) override
A Pooling2dDescriptor for the Pooling2dLayer.
void VisitGatherLayer(const IConnectableLayer *, const GatherDescriptor &, const char *) override
A NormalizationDescriptor for the NormalizationLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
void VisitConvolution2dLayer(const IConnectableLayer *, const Convolution2dDescriptor &, const char *) override
A SoftmaxDescriptor for the SoftmaxLayer.
void VisitComparisonLayer(const IConnectableLayer *, const ComparisonDescriptor &, const char *) override
void VisitRankLayer(const IConnectableLayer *, const char *) override
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
void VisitElementwiseUnaryLayer(const IConnectableLayer *, const ElementwiseUnaryDescriptor &, const char *) override
A PermuteDescriptor for the PermuteLayer.
void VisitActivationLayer(const IConnectableLayer *, const ActivationDescriptor &, const char *) override
void VisitReshapeLayer(const IConnectableLayer *, const ReshapeDescriptor &, const char *) override
void VisitReduceLayer(const IConnectableLayer *, const ReduceDescriptor &, const char *) override