jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 7 | #include <armnn/DescriptorsFwd.hpp> |
Matthew Bentham | 313e1c8 | 2019-03-25 17:37:47 +0000 | [diff] [blame] | 8 | #include <armnn/NetworkFwd.hpp> |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 9 | #include <armnn/Optional.hpp> |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 10 | #include <armnn/TensorFwd.hpp> |
| 11 | #include <armnn/Types.hpp> |
| 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | class ILayerVisitor |
| 16 | { |
jimfly01 | e9e7bfd | 2019-01-24 22:29:33 +0000 | [diff] [blame] | 17 | protected: |
| 18 | ILayerVisitor() {} |
| 19 | virtual ~ILayerVisitor() {} |
| 20 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 21 | public: |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 22 | /// Function that an activation layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 23 | /// @param layer - pointer to the layer which is calling back to this visit function. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 24 | /// @param activationDescriptor - ActivationDescriptor to configure the activation. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 25 | /// @param name - Optional name for the layer. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 26 | virtual void VisitActivationLayer(const IConnectableLayer* layer, |
| 27 | const ActivationDescriptor& activationDescriptor, |
| 28 | const char* name = nullptr) = 0; |
| 29 | |
| 30 | /// Function that an addition layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 31 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 32 | /// @param name - Optional name for the layer. |
| 33 | virtual void VisitAdditionLayer(const IConnectableLayer* layer, |
| 34 | const char* name = nullptr) = 0; |
| 35 | |
| 36 | /// Function that a batch normalization layer should call back to when its Accept(ILayerVisitor&) |
| 37 | /// function is invoked. |
| 38 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 39 | /// @param mean - Pre-calculated mean for each channel. |
| 40 | /// @param variance - Pre-calculated variance for each channel. |
| 41 | /// @param beta - Per-channel additive factor. |
| 42 | /// @param gamma - Per-channel multiplicative factor. |
| 43 | /// @param name - Optional name for the layer. |
| 44 | virtual void VisitBatchNormalizationLayer(const IConnectableLayer* layer, |
| 45 | const BatchNormalizationDescriptor& desc, |
| 46 | const ConstTensor& mean, |
| 47 | const ConstTensor& variance, |
| 48 | const ConstTensor& beta, |
| 49 | const ConstTensor& gamma, |
| 50 | const char* name = nullptr) = 0; |
| 51 | |
| 52 | /// Function that a batch to space ND layer should call back to when its Accept(ILayerVisitor&) |
| 53 | /// function is invoked. |
| 54 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 55 | /// @param batchToSpaceNdDescriptor - Description of the layer. |
| 56 | /// @param name - Optional name for the layer. |
| 57 | virtual void VisitBatchToSpaceNdLayer(const IConnectableLayer* layer, |
| 58 | const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor, |
| 59 | const char* name = nullptr) = 0; |
| 60 | |
| 61 | /// Function a layer with no inputs and a single output, which always corresponds to |
| 62 | /// the passed in constant tensor should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 63 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 64 | /// @param input - Tensor to be provided as the only output of the layer. The layer will maintain |
| 65 | /// its own copy of the tensor data, meaning the memory referenced by @a input can |
| 66 | /// be freed or reused after this function is called. |
| 67 | /// @param name - Optional name for the layer. |
| 68 | virtual void VisitConstantLayer(const IConnectableLayer* layer, |
| 69 | const ConstTensor& input, |
| 70 | const char* name = nullptr) = 0; |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 71 | |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 72 | /// Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&) |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 73 | /// function is invoked. |
| 74 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 75 | /// @param convolution2dDescriptor - Description of the 2D convolution layer. |
| 76 | /// @param weights - Tensor for the weights data. |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 77 | /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 78 | /// @param name - Optional name for the layer. |
| 79 | virtual void VisitConvolution2dLayer(const IConnectableLayer* layer, |
| 80 | const Convolution2dDescriptor& convolution2dDescriptor, |
| 81 | const ConstTensor& weights, |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 82 | const Optional<ConstTensor>& biases, |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 83 | const char* name = nullptr) = 0; |
| 84 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 85 | /// Function that a 2D depthwise convolution layer with biases should call back to when its |
| 86 | /// Accept(ILayerVisitor&) function is invoked. |
| 87 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 88 | /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer. |
| 89 | /// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width]. |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 90 | /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 91 | /// @param name - Optional name for the layer. |
| 92 | virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer, |
| 93 | const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, |
| 94 | const ConstTensor& weights, |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 95 | const Optional<ConstTensor>& biases, |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 96 | const char* name = nullptr) = 0; |
| 97 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 98 | /// Function that a Dequantize layer should call back to when its |
| 99 | /// Accept(ILayerVisitor&) function is invoked. |
| 100 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 101 | /// @param name - Optional name for the layer. |
| 102 | virtual void VisitDequantizeLayer(const IConnectableLayer* layer, |
| 103 | const char* name = nullptr) = 0; |
| 104 | |
jimfly01 | d161ba0 | 2019-01-28 12:51:53 +0000 | [diff] [blame] | 105 | /// Function that a Detection PostProcess layer should call back to when its |
| 106 | /// Accept(ILayerVisitor&) function is invoked. |
| 107 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 108 | /// @param descriptor - Description of the Detection PostProcess layer. |
Narumol Prangnawarat | 6d302bf | 2019-02-04 11:46:26 +0000 | [diff] [blame] | 109 | /// @param anchors - Tensor for the anchors. |
jimfly01 | d161ba0 | 2019-01-28 12:51:53 +0000 | [diff] [blame] | 110 | /// @param name - Optional name for the layer. |
| 111 | virtual void VisitDetectionPostProcessLayer(const IConnectableLayer* layer, |
| 112 | const DetectionPostProcessDescriptor& descriptor, |
Narumol Prangnawarat | 6d302bf | 2019-02-04 11:46:26 +0000 | [diff] [blame] | 113 | const ConstTensor& anchors, |
jimfly01 | d161ba0 | 2019-01-28 12:51:53 +0000 | [diff] [blame] | 114 | const char* name = nullptr) = 0; |
| 115 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 116 | /// Function a division layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 117 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 118 | /// @param name - Optional name for the layer. |
| 119 | virtual void VisitDivisionLayer(const IConnectableLayer* layer, |
| 120 | const char* name = nullptr) = 0; |
| 121 | |
| 122 | /// Function an Equal layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 123 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 124 | /// @param name - Optional name for the layer. |
| 125 | virtual void VisitEqualLayer(const IConnectableLayer* layer, |
| 126 | const char* name = nullptr) = 0; |
| 127 | |
| 128 | /// Function a floor layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 129 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 130 | /// @param name - Optional name for the layer. |
| 131 | virtual void VisitFloorLayer(const IConnectableLayer* layer, |
| 132 | const char* name = nullptr) = 0; |
| 133 | |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 134 | /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&) |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 135 | /// function is invoked. |
| 136 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 137 | /// @param fullyConnectedDescriptor - Description of the fully connected layer. |
| 138 | /// @param weights - Tensor for the weights data. |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 139 | /// @param biases - Optional tensor for the bias data. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 140 | /// @param name - Optional name for the layer. |
| 141 | virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer, |
| 142 | const FullyConnectedDescriptor& fullyConnectedDescriptor, |
| 143 | const ConstTensor& weights, |
Aron Virginas-Tar | 0085978 | 2019-02-11 12:21:27 +0000 | [diff] [blame] | 144 | const Optional<ConstTensor>& biases, |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 145 | const char* name = nullptr) = 0; |
| 146 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 147 | /// Function a Gather layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 148 | /// @param layer - pointer to the layer which is calling back to this visit function. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 149 | /// @param name - Optional name for the layer. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 150 | virtual void VisitGatherLayer(const IConnectableLayer* layer, |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 151 | const char* name = nullptr) = 0; |
| 152 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 153 | /// Function a Greater layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 154 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 155 | /// @param name - Optional name for the layer. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 156 | virtual void VisitGreaterLayer(const IConnectableLayer* layer, |
| 157 | const char* name = nullptr) = 0; |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 158 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 159 | /// Function that an InputLayer should call back to when its Accept(ILayerVisitor&) function is invoked. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 160 | /// @param layer - pointer to the layer which is calling back to this visit function. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 161 | /// @param id - User generated id to uniquely identify a particular input. The same id needs to be specified |
| 162 | /// when passing the inputs to the IRuntime::EnqueueWorkload() function. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 163 | /// @param name - Optional name for the layer. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 164 | virtual void VisitInputLayer(const IConnectableLayer* layer, |
| 165 | LayerBindingId id, |
| 166 | const char* name = nullptr) = 0; |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 167 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 168 | |
| 169 | /// Function that an L2 normalization layer should call back to when its Accept(ILayerVisitor&) |
| 170 | /// function is invoked. Normalization is performed along dimension 1, but requires a 4d input. |
| 171 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 172 | /// @param desc - Parameters for the L2 normalization operation. |
| 173 | /// @param name - Optional name for the layer. |
| 174 | virtual void VisitL2NormalizationLayer(const IConnectableLayer* layer, |
| 175 | const L2NormalizationDescriptor& desc, |
| 176 | const char* name = nullptr) = 0; |
| 177 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 178 | /// Function an Lstm layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 179 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 180 | /// @param descriptor - Parameters controlling the operation of the Lstm operation. |
| 181 | /// @param params - The weights and biases for the LSTM cell. |
| 182 | /// @param name - Optional name for the layer. |
| 183 | virtual void VisitLstmLayer(const IConnectableLayer* layer, |
| 184 | const LstmDescriptor& descriptor, |
| 185 | const LstmInputParams& params, |
| 186 | const char* name = nullptr) = 0; |
| 187 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 188 | /// Function a Maximum layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 189 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 190 | /// @param name - Optional name for the layer. |
| 191 | virtual void VisitMaximumLayer(const IConnectableLayer* layer, |
| 192 | const char* name = nullptr) = 0; |
| 193 | |
| 194 | /// Function a Mean layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 195 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 196 | /// @param meanDescriptor - Parameters for the mean operation. |
| 197 | /// @param name - Optional name for the layer. |
| 198 | virtual void VisitMeanLayer(const IConnectableLayer* layer, |
| 199 | const MeanDescriptor& meanDescriptor, |
| 200 | const char* name = nullptr) = 0; |
| 201 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 202 | /// Function that a merge layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 203 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 204 | /// @param name - Optional name for the layer. |
| 205 | virtual void VisitMergeLayer(const IConnectableLayer* layer, |
| 206 | const char* name = nullptr) = 0; |
| 207 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 208 | /// Function that a merger layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 209 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 210 | /// @param mergerDescriptor - WindowsDescriptor to configure the merging process. Number of Views must be equal to |
| 211 | /// the number of inputs, and their order must match - e.g. first view corresponds to |
| 212 | /// the first input, second view to the second input, etc.... |
| 213 | /// @param name - Optional name for the layer. |
| 214 | virtual void VisitMergerLayer(const IConnectableLayer* layer, |
| 215 | const OriginsDescriptor& mergerDescriptor, |
| 216 | const char* name = nullptr) = 0; |
| 217 | |
| 218 | /// Function a Minimum layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 219 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 220 | /// @param name - Optional name for the layer. |
| 221 | virtual void VisitMinimumLayer(const IConnectableLayer* layer, |
| 222 | const char* name = nullptr) = 0; |
| 223 | |
| 224 | /// Function that a multiplication layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 225 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 226 | /// @param name - Optional name for the layer. |
| 227 | virtual void VisitMultiplicationLayer(const IConnectableLayer* layer, |
| 228 | const char* name = nullptr) = 0; |
| 229 | |
| 230 | /// Function that a normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 231 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 232 | /// @param normalizationDescriptor - NormalizationDescriptor to configure the normalization. |
| 233 | /// @param name - Optional name for the layer. |
| 234 | virtual void VisitNormalizationLayer(const IConnectableLayer* layer, |
| 235 | const NormalizationDescriptor& normalizationDescriptor, |
| 236 | const char* name = nullptr) = 0; |
| 237 | |
| 238 | /// Function an output layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 239 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 240 | /// @param id - User generated id to uniquely identify a particular output. The same id needs to be specified |
| 241 | /// when passing the outputs to the IRuntime::EnqueueWorkload() function. |
| 242 | /// @param name - Optional name for the layer. |
| 243 | virtual void VisitOutputLayer(const IConnectableLayer* layer, |
| 244 | LayerBindingId id, |
| 245 | const char* name = nullptr) = 0; |
| 246 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 247 | /// Function a pad layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 248 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 249 | /// @param paddings - n by 2 tensor, where n is the rank of the input tensor, |
| 250 | /// such that paddings[i,0] indicates the amount of padding to add in front of dimension i, and |
| 251 | /// paddings[i,1] indicates the amount of padding to add after the end of dimension i |
| 252 | /// @param name - Optional name for the layer. |
| 253 | virtual void VisitPadLayer(const IConnectableLayer* layer, |
| 254 | const PadDescriptor& padDescriptor, |
| 255 | const char* name = nullptr) = 0; |
| 256 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 257 | /// Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 258 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 259 | /// @param permuteDescriptor - PermuteDescriptor to configure the permute. |
| 260 | /// @param name - Optional name for the layer. |
| 261 | virtual void VisitPermuteLayer(const IConnectableLayer* layer, |
| 262 | const PermuteDescriptor& permuteDescriptor, |
| 263 | const char* name = nullptr) = 0; |
| 264 | |
| 265 | /// Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 266 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 267 | /// @param pooling2dDescriptor - Pooling2dDescriptor to configure the pooling. |
| 268 | /// @param name - Optional name for the layer. |
| 269 | virtual void VisitPooling2dLayer(const IConnectableLayer* layer, |
| 270 | const Pooling2dDescriptor& pooling2dDescriptor, |
| 271 | const char* name = nullptr) = 0; |
| 272 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 273 | /// Function a quantize layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 274 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 275 | /// @param name - Optional name for the layer. |
| 276 | virtual void VisitQuantizeLayer(const IConnectableLayer* layer, |
| 277 | const char* name = nullptr) = 0; |
| 278 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 279 | /// Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 280 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 281 | /// @param reshapeDescriptor - Parameters for the reshape operation. |
| 282 | /// @param name - Optional name for the layer. |
| 283 | virtual void VisitReshapeLayer(const IConnectableLayer* layer, |
| 284 | const ReshapeDescriptor& reshapeDescriptor, |
| 285 | const char* name = nullptr) = 0; |
| 286 | |
| 287 | /// Function that a resize bilinear layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 288 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 289 | /// @param resizeDesc - Parameters for the resize operation. |
| 290 | /// @param name - Optional name for the layer. |
| 291 | virtual void VisitResizeBilinearLayer(const IConnectableLayer* layer, |
| 292 | const ResizeBilinearDescriptor& resizeDesc, |
| 293 | const char* name = nullptr) = 0; |
| 294 | |
| 295 | /// Function a Reciprocal of square root layer should call back to when its Accept(ILayerVisitor&) |
| 296 | /// function is invoked. |
| 297 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 298 | /// @param name - Optional name for the layer. |
| 299 | virtual void VisitRsqrtLayer(const IConnectableLayer* layer, |
| 300 | const char* name = nullptr) = 0; |
| 301 | |
| 302 | |
| 303 | /// Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 304 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 305 | /// @param softmaxDescriptor - SoftmaxDescriptor to configure the softmax. |
| 306 | /// @param name - Optional name for the layer. |
| 307 | virtual void VisitSoftmaxLayer(const IConnectableLayer* layer, |
| 308 | const SoftmaxDescriptor& softmaxDescriptor, |
| 309 | const char* name = nullptr) = 0; |
| 310 | |
| 311 | /// Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 312 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 313 | /// @param spaceToBatchNdDescriptor - Parameters for the space to batch operation. |
| 314 | /// @param name - Optional name for the layer. |
| 315 | virtual void VisitSpaceToBatchNdLayer(const IConnectableLayer* layer, |
| 316 | const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor, |
| 317 | const char* name = nullptr) = 0; |
| 318 | |
| 319 | /// Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 320 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 321 | /// @param splitterDescriptor - WindowsDescriptor to configure the splitting process. |
| 322 | /// Number of Views must be equal to the number of outputs, |
| 323 | /// and their order must match - e.g. first view corresponds to |
| 324 | /// the first output, second view to the second output, etc.... |
| 325 | /// @param name - Optional name for the layer. |
| 326 | virtual void VisitSplitterLayer(const IConnectableLayer* layer, |
| 327 | const ViewsDescriptor& splitterDescriptor, |
| 328 | const char* name = nullptr) = 0; |
| 329 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 330 | /// Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 331 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 332 | /// @param StridedSliceDescriptor - Parameters for the strided slice operation. |
| 333 | /// @param name - Optional name for the layer. |
| 334 | virtual void VisitStridedSliceLayer(const IConnectableLayer* layer, |
| 335 | const StridedSliceDescriptor& stridedSliceDescriptor, |
| 336 | const char* name = nullptr) = 0; |
| 337 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 338 | /// Function a subtraction layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 339 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 340 | /// @param name - Optional name for the layer. |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 341 | virtual void VisitSubtractionLayer(const IConnectableLayer* layer, |
| 342 | const char* name = nullptr) = 0; |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 343 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame^] | 344 | /// Function a switch layer should call back to when its Accept(ILayerVisitor&) function is invoked. |
| 345 | /// @param layer - pointer to the layer which is calling back to this visit function. |
| 346 | /// @param name - Optional name for the layer. |
| 347 | virtual void VisitSwitchLayer(const IConnectableLayer* layer, |
| 348 | const char* name = nullptr) = 0; |
| 349 | |
jimfly01 | 5f4e41f | 2019-01-23 16:10:17 +0000 | [diff] [blame] | 350 | |
| 351 | }; |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 352 | } // namespace armnn |