ArmNN
 20.05
Network.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 #include <armnn/LstmParams.hpp>
10 #include <armnn/TensorFwd.hpp>
11 #include <armnn/Types.hpp>
12 
13 #include <armnn/INetwork.hpp>
14 
15 #include <string>
16 #include <vector>
17 #include <map>
18 #include <memory>
19 
20 #include "Graph.hpp"
21 #include "Layer.hpp"
22 
23 namespace armnn
24 {
25 class Graph;
26 
27 /// Private implementation of INetwork.
28 class Network final : public INetwork
29 {
30 public:
31  Network();
32  ~Network();
33 
34  const Graph& GetGraph() const { return *m_Graph; }
35 
36  Status PrintGraph() override;
37 
38  IConnectableLayer* AddInputLayer(LayerBindingId id, const char* name=nullptr) override;
39 
41  const char* name = nullptr) override;
42 
43  IConnectableLayer* AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
44  const char* name = nullptr) override;
45 
46  IConnectableLayer* AddComparisonLayer(const ComparisonDescriptor& comparisonDescriptor,
47  const char* name = nullptr) override;
48 
49  IConnectableLayer* AddConcatLayer(const ConcatDescriptor& concatDescriptor,
50  const char* name = nullptr) override;
51 
52  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
53  const ConstTensor& weights,
54  const Optional<ConstTensor>& biases,
55  const char* name = nullptr) override;
56 
57  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
58  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
59  const ConstTensor& weights,
60  const char* name = nullptr) override;
61 
62  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
63  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
64  const ConstTensor& weights,
65  const ConstTensor& biases,
66  const char* name = nullptr) override;
67 
68  IConnectableLayer* AddDepthToSpaceLayer(const DepthToSpaceDescriptor& depthToSpaceDescriptor,
69  const char* name = nullptr) override;
70 
72  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
73  const ConstTensor& weights,
74  const Optional<ConstTensor>& biases,
75  const char* name = nullptr) override;
76 
77  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
79  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
80  const ConstTensor& weights,
81  const char* name = nullptr) override;
82 
83  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
85  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
86  const ConstTensor& weights,
87  const ConstTensor& biases,
88  const char* name = nullptr) override;
89 
90  IConnectableLayer* AddDequantizeLayer(const char* name = nullptr) override;
91 
93  const DetectionPostProcessDescriptor& descriptor,
94  const ConstTensor& anchors,
95  const char* name = nullptr) override;
96 
98  const char* name = nullptr) override;
99 
100  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
101  const ConstTensor& weights,
102  const Optional<ConstTensor>& biases,
103  const char* name = nullptr) override;
104 
105  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
106  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
107  const ConstTensor& weights,
108  const char* name = nullptr) override;
109 
110  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
111  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
112  const ConstTensor& weights,
113  const ConstTensor& biases,
114  const char* name = nullptr) override;
115 
116  IConnectableLayer* AddGatherLayer(const char* name = nullptr) override;
117 
118  IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor,
119  const char* name = nullptr) override;
120 
121  IConnectableLayer* AddPooling2dLayer(const Pooling2dDescriptor& pooling2dDescriptor,
122  const char* name = nullptr) override;
123 
124  IConnectableLayer* AddActivationLayer(const ActivationDescriptor& activationDescriptor,
125  const char* name = nullptr) override;
126 
127  IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor,
128  const char* name = nullptr) override;
129 
130  IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr) override;
131 
132  IConnectableLayer* AddSoftmaxLayer(const SoftmaxDescriptor& softmaxDescriptor,
133  const char* name = nullptr) override;
134 
135  IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor,
136  const char* name = nullptr) override;
137 
138  ARMNN_DEPRECATED_MSG("Use AddConcatLayer instead")
139  IConnectableLayer* AddMergerLayer(const MergerDescriptor& mergerDescriptor,
140  const char* name = nullptr) override;
141 
142  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
143  IConnectableLayer* AddAbsLayer(const char* name = nullptr) override;
144 
145  IConnectableLayer* AddAdditionLayer(const char* name = nullptr) override;
146 
147  IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr) override;
148 
150  const ConstTensor& mean,
151  const ConstTensor& variance,
152  const ConstTensor& beta,
153  const ConstTensor& gamma,
154  const char* name = nullptr) override;
155 
156  ARMNN_DEPRECATED_MSG("Use AddResizeLayer instead")
158  const char* name = nullptr) override;
159 
160  IConnectableLayer* AddResizeLayer(const ResizeDescriptor& resizeDescriptor,
161  const char* name = nullptr) override;
162 
164  const char* name = nullptr) override;
165 
167  const char* name = nullptr) override;
168 
169  IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
170  const char* name = nullptr) override;
171 
172  IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr) override;
173 
174  IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
175  const char* name = nullptr) override;
176 
177  IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
178  const char* name = nullptr) override;
179 
180  IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
181  const char* name = nullptr) override;
182 
183  IConnectableLayer* AddFloorLayer(const char* name = nullptr) override;
184 
185  IConnectableLayer* AddOutputLayer(LayerBindingId id, const char* name = nullptr) override;
186 
187  IConnectableLayer* AddLstmLayer(const LstmDescriptor& descriptor,
188  const LstmInputParams& params,
189  const char* name = nullptr) override;
190 
191  IConnectableLayer* AddDivisionLayer(const char* name = nullptr) override;
192 
193  IConnectableLayer* AddSubtractionLayer(const char* name = nullptr) override;
194 
195  IConnectableLayer* AddMaximumLayer(const char* name = nullptr) override;
196 
197  IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr) override;
198 
199  IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr) override;
200 
201  IConnectableLayer* AddQuantizeLayer(const char* name = nullptr) override;
202 
203  IConnectableLayer* AddStridedSliceLayer(const StridedSliceDescriptor& stridedSliceDescriptor,
204  const char* name = nullptr) override;
205 
206  IConnectableLayer* AddMinimumLayer(const char* name = nullptr) override;
207 
208  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
209  IConnectableLayer* AddGreaterLayer(const char* name = nullptr) override;
210 
211  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
212  IConnectableLayer* AddEqualLayer(const char* name = nullptr) override;
213 
214  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
215  IConnectableLayer* AddRsqrtLayer(const char* name = nullptr) override;
216 
217  IConnectableLayer* AddMergeLayer(const char* name = nullptr) override;
218 
219  IConnectableLayer* AddSwitchLayer(const char* name = nullptr) override;
220 
221  IConnectableLayer* AddPreluLayer(const char* name = nullptr) override;
222 
224  const ConstTensor& weights,
225  const Optional<ConstTensor>& biases,
226  const char* name = nullptr) override;
227 
228  IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
229  const char* name = nullptr) override;
230 
231  IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
232  const char* name = nullptr) override;
233 
235  const char* name = nullptr) override;
236 
238  const LstmInputParams& params,
239  const char* name = nullptr) override;
240 
242  const char* name = nullptr) override;
243 
244  void Accept(ILayerVisitor& visitor) const override;
245 
246 private:
247  IConnectableLayer* AddFullyConnectedLayerImpl(const FullyConnectedDescriptor& fullyConnectedDescriptor,
248  const ConstTensor& weights,
249  const Optional<ConstTensor>& biases,
250  const char* name);
251 
252  IConnectableLayer* AddConvolution2dLayerImpl(const Convolution2dDescriptor& convolution2dDescriptor,
253  const ConstTensor& weights,
254  const Optional<ConstTensor>& biases,
255  const char* name);
256 
257  IConnectableLayer* AddDepthwiseConvolution2dLayerImpl(
258  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
259  const ConstTensor& weights,
260  const Optional<ConstTensor>& biases,
261  const char* name);
262 
263  std::unique_ptr<Graph> m_Graph;
264 };
265 
267 {
268 public:
269  OptimizedNetwork(std::unique_ptr<Graph> graph);
270  ~OptimizedNetwork();
271 
272  Status PrintGraph() override;
273  Status SerializeToDot(std::ostream& stream) const override;
274 
275  profiling::ProfilingGuid GetGuid() const final { return m_Guid; };
276 
277  Graph& GetGraph() { return *m_Graph; }
278 
279 private:
280  std::unique_ptr<Graph> m_Graph;
282 };
283 
284 
285 
287 {
288  bool m_Warning;
289  bool m_Error;
290 
292  : m_Warning(warning)
293  , m_Error(error)
294  {}
295 
298  {}
299 
300  bool IsOk() const { return !m_Warning && !m_Error; }
301  bool IsWarningOnly() const { return m_Warning && !m_Error; }
302  bool IsError() const { return m_Error; }
303 
304 };
305 
306 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
307 
309  struct BackendSettings& backendSettings);
310 
312  BackendsMap& backends,
313  TensorHandleFactoryRegistry& registry,
314  Optional<std::vector<std::string>&> errMessages);
315 
317  BackendSettings& backendSettings,
318  Graph::Iterator& firstLayer,
319  Graph::Iterator& lastLayer,
320  Optional<std::vector<std::string>&> errMessages);
321 
322 } // namespace armnn
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
Adds a pooling layer to the network.
Definition: Network.cpp:1362
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an output layer to the network.
Definition: Network.cpp:1435
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr) override
Adds an L2 normalization layer to the network.
Definition: Network.cpp:1481
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:291
IConnectableLayer * AddResizeBilinearLayer(const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Adds a resize bilinear layer to the network.
Definition: Network.cpp:1457
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
Add a Mean layer to the network.
Definition: Network.cpp:1676
A ReshapeDescriptor for the ReshapeLayer.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:70
DataLayout::NHWC false
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr) override
Adds a log softmax layer to the network.
Definition: Network.cpp:1487
A Convolution2dDescriptor for the Convolution2dLayer.
IConnectableLayer * AddDepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Adds a 2D depthwise convolution layer to the network.
Definition: Network.cpp:1318
const Graph & GetGraph() const
Definition: Network.hpp:34
IConnectableLayer * AddSwitchLayer(const char *name=nullptr) override
Adds a switch layer to the network.
Definition: Network.cpp:1727
IConnectableLayer * AddFloorLayer(const char *name=nullptr) override
Adds a floor layer to the network.
Definition: Network.cpp:1520
profiling::ProfilingGuid GetGuid() const final
Definition: Network.hpp:275
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an input layer to the network.
Definition: Network.cpp:1166
Main network class which provides the interface for building up a neural network. ...
Definition: INetwork.hpp:105
void Accept(ILayerVisitor &visitor) const override
Definition: Network.cpp:1958
IConnectableLayer * AddMinimumLayer(const char *name=nullptr) override
Add a Minimum layer to the network.
Definition: Network.cpp:1409
Copyright (c) 2020 ARM Limited.
IConnectableLayer * AddQLstmLayer(const QLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
Add a QLstm layer to the network.
Definition: Network.cpp:1816
LayerList::const_iterator Iterator
Definition: Graph.hpp:51
IConnectableLayer * AddFullyConnectedLayer(const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Adds a fully connected layer to the network.
Definition: Network.cpp:1211
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:937
IConnectableLayer * AddRsqrtLayer(const char *name=nullptr) override
Add Reciprocal of square root layer to the network.
Definition: Network.cpp:1712
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:171
A ResizeDescriptor for the ResizeLayer.
IConnectableLayer * AddEqualLayer(const char *name=nullptr) override
Add a Equal layer to the network.
Definition: Network.cpp:1707
IConnectableLayer * AddConvolution2dLayer(const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Adds a 2D convolution layer to the network.
Definition: Network.cpp:1264
A StackDescriptor for the StackLayer.
IConnectableLayer * AddTransposeConvolution2dLayer(const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Adds a 2D transpose convolution layer to the network.
Definition: Network.cpp:1737
A PadDescriptor for the PadLayer.
IConnectableLayer * AddReshapeLayer(const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr) override
Adds a reshape layer to the network.
Definition: Network.cpp:1502
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr) override
Adds a transpose layer to the network.
Definition: Network.cpp:1759
IConnectableLayer * AddMergeLayer(const char *name=nullptr) override
Adds a merge layer to the network.
Definition: Network.cpp:1722
IConnectableLayer * AddMaximumLayer(const char *name=nullptr) override
Add a Maximum layer to the network.
Definition: Network.cpp:1404
An LstmDescriptor for the LstmLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:51
An OriginsDescriptor for the ConcatLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:199
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
Adds a concatenation layer to the network.
Definition: Network.cpp:1236
Status
enumeration
Definition: Types.hpp:26
IConnectableLayer * AddPadLayer(const PadDescriptor &padDescriptor, const char *name=nullptr) override
Adds a fully pad layer to the network.
Definition: Network.cpp:1681
IConnectableLayer * AddStandInLayer(const StandInDescriptor &descriptor, const char *name=nullptr) override
Add a stand-in layer for a type unknown to the Arm NN framework.
Definition: Network.cpp:1772
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
Adds an activation layer to the network.
Definition: Network.cpp:1368
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr) override
Adds a subtraction layer to the network.
Definition: Network.cpp:1671
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
Adds an instance normalization layer to the network.
Definition: Network.cpp:1475
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr) override
Adds a depth to space layer to the network.
Definition: Network.cpp:1312
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:20
IConnectableLayer * AddStackLayer(const StackDescriptor &stackDescriptor, const char *name=nullptr) override
Adds a stack layer to the network.
Definition: Network.cpp:1765
A SliceDescriptor for the SliceLayer.
IConnectableLayer * AddSplitterLayer(const ViewsDescriptor &splitterDescriptor, const char *name=nullptr) override
Adds a splitter layer to the network.
Definition: Network.cpp:1398
Status PrintGraph() override
Definition: Network.cpp:1160
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
Adds a space to depth layer to the network.
Definition: Network.cpp:1514
Private implementation of INetwork.
Definition: Network.hpp:28
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
IConnectableLayer * AddPreluLayer(const char *name=nullptr) override
Adds a PReLU layer to the network.
Definition: Network.cpp:1732
bool IsWarningOnly() const
Definition: Network.hpp:301
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr) override
Add a quantize layer to the network.
Definition: Network.cpp:1686
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
Adds an ArgMinMax layer to the network.
Definition: Network.cpp:1374
OptimizationResult AssignBackends(OptimizedNetwork *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:382
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:90
IConnectableLayer * AddBatchNormalizationLayer(const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr) override
Adds a batch normalization layer to the network.
Definition: Network.cpp:1440
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Adds a batch to space ND layer to the network.
Definition: Network.cpp:1171
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition: Network.cpp:522
IConnectableLayer * AddAdditionLayer(const char *name=nullptr) override
Adds an addition layer to the network.
Definition: Network.cpp:1425
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr) override
Adds a Dequantize layer to the network.
Definition: Network.cpp:1691
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Adds a space to batch layer to the network.
Definition: Network.cpp:1508
IConnectableLayer * AddAbsLayer(const char *name=nullptr) override
Add absolute layer to the network.
Definition: Network.cpp:1420
A MeanDescriptor for the MeanLayer.
IConnectableLayer * AddSliceLayer(const SliceDescriptor &sliceDescriptor, const char *name=nullptr) override
Adds a slice layer to the network.
Definition: Network.cpp:1387
IConnectableLayer * AddGreaterLayer(const char *name=nullptr) override
Add a Greater layer to the network.
Definition: Network.cpp:1702
IConnectableLayer * AddMergerLayer(const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
Adds a concat layer to the network.
Definition: Network.cpp:1414
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
Adds a resize layer to the network.
Definition: Network.cpp:1469
IConnectableLayer * AddConstantLayer(const ConstTensor &input, const char *name=nullptr) override
Adds a layer with no inputs and a single output, which always corresponds to the passed in constant t...
Definition: Network.cpp:1493
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
IConnectableLayer * AddMultiplicationLayer(const char *name=nullptr) override
Adds a multiplication layer to the network.
Definition: Network.cpp:1430
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1177
#define ARMNN_DEPRECATED_MSG(message)
Definition: Deprecated.hpp:43
IConnectableLayer * AddNormalizationLayer(const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr) override
Adds a normalization layer to the network.
Definition: Network.cpp:1380
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
IConnectableLayer * AddPermuteLayer(const PermuteDescriptor &permuteDescriptor, const char *name=nullptr) override
Adds a permute layer to the network.
Definition: Network.cpp:1356
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1717
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Adds a softmax layer to the network.
Definition: Network.cpp:1392
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
Add a Lstm layer to the network.
Definition: Network.cpp:1525
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
Add an ElementwiseUnary layer to the network.
Definition: Network.cpp:1183
IConnectableLayer * AddDivisionLayer(const char *name=nullptr) override
Adds a division layer to the network.
Definition: Network.cpp:1666
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Adds a strided slice layer to the network.
Definition: Network.cpp:1696
A SoftmaxDescriptor for the SoftmaxLayer.
IConnectableLayer * AddQuantizedLstmLayer(const QuantizedLstmInputParams &params, const char *name=nullptr) override
Add a QuantizedLstm layer to the network.
Definition: Network.cpp:1778
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
Adds a Detection PostProcess layer to the network.
Definition: Network.cpp:1346
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:306
A PermuteDescriptor for the PermuteLayer.
std::vector< float > anchors({ 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 100.5f, 1.0f, 1.0f })