ArmNN
 20.02
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  profiling::ProfilingGuid GetGuid() const final { return m_Guid; };
39 
40  IConnectableLayer* AddInputLayer(LayerBindingId id, const char* name=nullptr) override;
41 
43  const char* name = nullptr) override;
44 
45  IConnectableLayer* AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
46  const char* name = nullptr) override;
47 
48  IConnectableLayer* AddComparisonLayer(const ComparisonDescriptor& comparisonDescriptor,
49  const char* name = nullptr) override;
50 
51  IConnectableLayer* AddConcatLayer(const ConcatDescriptor& concatDescriptor,
52  const char* name = nullptr) override;
53 
54  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
55  const ConstTensor& weights,
56  const Optional<ConstTensor>& biases,
57  const char* name = nullptr) override;
58 
59  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
60  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
61  const ConstTensor& weights,
62  const char* name = nullptr) override;
63 
64  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
65  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
66  const ConstTensor& weights,
67  const ConstTensor& biases,
68  const char* name = nullptr) override;
69 
70  IConnectableLayer* AddDepthToSpaceLayer(const DepthToSpaceDescriptor& depthToSpaceDescriptor,
71  const char* name = nullptr) override;
72 
74  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
75  const ConstTensor& weights,
76  const Optional<ConstTensor>& biases,
77  const char* name = nullptr) override;
78 
79  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
81  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
82  const ConstTensor& weights,
83  const char* name = nullptr) override;
84 
85  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
87  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
88  const ConstTensor& weights,
89  const ConstTensor& biases,
90  const char* name = nullptr) override;
91 
92  IConnectableLayer* AddDequantizeLayer(const char* name = nullptr) override;
93 
95  const DetectionPostProcessDescriptor& descriptor,
96  const ConstTensor& anchors,
97  const char* name = nullptr) override;
98 
100  const char* name = nullptr) override;
101 
102  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
103  const ConstTensor& weights,
104  const Optional<ConstTensor>& biases,
105  const char* name = nullptr) override;
106 
107  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
108  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
109  const ConstTensor& weights,
110  const char* name = nullptr) override;
111 
112  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
113  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
114  const ConstTensor& weights,
115  const ConstTensor& biases,
116  const char* name = nullptr) override;
117 
118  IConnectableLayer* AddGatherLayer(const char* name = nullptr) override;
119 
120  IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor,
121  const char* name = nullptr) override;
122 
123  IConnectableLayer* AddPooling2dLayer(const Pooling2dDescriptor& pooling2dDescriptor,
124  const char* name = nullptr) override;
125 
126  IConnectableLayer* AddActivationLayer(const ActivationDescriptor& activationDescriptor,
127  const char* name = nullptr) override;
128 
129  IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor,
130  const char* name = nullptr) override;
131 
132  IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr) override;
133 
134  IConnectableLayer* AddSoftmaxLayer(const SoftmaxDescriptor& softmaxDescriptor,
135  const char* name = nullptr) override;
136 
137  IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor,
138  const char* name = nullptr) override;
139 
140  ARMNN_DEPRECATED_MSG("Use AddConcatLayer instead")
141  IConnectableLayer* AddMergerLayer(const MergerDescriptor& mergerDescriptor,
142  const char* name = nullptr) override;
143 
144  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
145  IConnectableLayer* AddAbsLayer(const char* name = nullptr) override;
146 
147  IConnectableLayer* AddAdditionLayer(const char* name = nullptr) override;
148 
149  IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr) override;
150 
152  const ConstTensor& mean,
153  const ConstTensor& variance,
154  const ConstTensor& beta,
155  const ConstTensor& gamma,
156  const char* name = nullptr) override;
157 
158  ARMNN_DEPRECATED_MSG("Use AddResizeLayer instead")
160  const char* name = nullptr) override;
161 
162  IConnectableLayer* AddResizeLayer(const ResizeDescriptor& resizeDescriptor,
163  const char* name = nullptr) override;
164 
166  const char* name = nullptr) override;
167 
169  const char* name = nullptr) override;
170 
171  IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
172  const char* name = nullptr) override;
173 
174  IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr) override;
175 
176  IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
177  const char* name = nullptr) override;
178 
179  IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
180  const char* name = nullptr) override;
181 
182  IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
183  const char* name = nullptr) override;
184 
185  IConnectableLayer* AddFloorLayer(const char* name = nullptr) override;
186 
187  IConnectableLayer* AddOutputLayer(LayerBindingId id, const char* name = nullptr) override;
188 
189  IConnectableLayer* AddLstmLayer(const LstmDescriptor& descriptor,
190  const LstmInputParams& params,
191  const char* name = nullptr) override;
192 
193  IConnectableLayer* AddDivisionLayer(const char* name = nullptr) override;
194 
195  IConnectableLayer* AddSubtractionLayer(const char* name = nullptr) override;
196 
197  IConnectableLayer* AddMaximumLayer(const char* name = nullptr) override;
198 
199  IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr) override;
200 
201  IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr) override;
202 
203  IConnectableLayer* AddQuantizeLayer(const char* name = nullptr) override;
204 
205  IConnectableLayer* AddStridedSliceLayer(const StridedSliceDescriptor& stridedSliceDescriptor,
206  const char* name = nullptr) override;
207 
208  IConnectableLayer* AddMinimumLayer(const char* name = nullptr) override;
209 
210  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
211  IConnectableLayer* AddGreaterLayer(const char* name = nullptr) override;
212 
213  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
214  IConnectableLayer* AddEqualLayer(const char* name = nullptr) override;
215 
216  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
217  IConnectableLayer* AddRsqrtLayer(const char* name = nullptr) override;
218 
219  IConnectableLayer* AddMergeLayer(const char* name = nullptr) override;
220 
221  IConnectableLayer* AddSwitchLayer(const char* name = nullptr) override;
222 
223  IConnectableLayer* AddPreluLayer(const char* name = nullptr) override;
224 
226  const ConstTensor& weights,
227  const Optional<ConstTensor>& biases,
228  const char* name = nullptr) override;
229 
230  IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
231  const char* name = nullptr) override;
232 
233  IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
234  const char* name = nullptr) override;
235 
237  const char* name = nullptr) override;
238 
240  const char* name = nullptr) override;
241 
242  void Accept(ILayerVisitor& visitor) const override;
243 
244 private:
245  IConnectableLayer* AddFullyConnectedLayerImpl(const FullyConnectedDescriptor& fullyConnectedDescriptor,
246  const ConstTensor& weights,
247  const Optional<ConstTensor>& biases,
248  const char* name);
249 
250  IConnectableLayer* AddConvolution2dLayerImpl(const Convolution2dDescriptor& convolution2dDescriptor,
251  const ConstTensor& weights,
252  const Optional<ConstTensor>& biases,
253  const char* name);
254 
255  IConnectableLayer* AddDepthwiseConvolution2dLayerImpl(
256  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
257  const ConstTensor& weights,
258  const Optional<ConstTensor>& biases,
259  const char* name);
260 
261  std::unique_ptr<Graph> m_Graph;
263 };
264 
266 {
267 public:
268  OptimizedNetwork(std::unique_ptr<Graph> graph);
269  ~OptimizedNetwork();
270 
271  Status PrintGraph() override;
272  Status SerializeToDot(std::ostream& stream) const override;
273 
274  profiling::ProfilingGuid GetGuid() const final { return m_Guid; };
275 
276  Graph& GetGraph() { return *m_Graph; }
277 
278 private:
279  std::unique_ptr<Graph> m_Graph;
281 };
282 
283 
284 
286 {
287  bool m_Warning;
288  bool m_Error;
289 
291  : m_Warning(warning)
292  , m_Error(error)
293  {}
294 
297  {}
298 
299  bool IsOk() const { return !m_Warning && !m_Error; }
300  bool IsWarningOnly() const { return m_Warning && !m_Error; }
301  bool IsError() const { return m_Error; }
302 
303 };
304 
305 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
306 
308  struct BackendSettings& backendSettings);
309 
311  BackendsMap& backends,
312  TensorHandleFactoryRegistry& registry,
313  Optional<std::vector<std::string>&> errMessages);
314 
316  BackendSettings& backendSettings,
317  Graph::Iterator& firstLayer,
318  Graph::Iterator& lastLayer,
319  Optional<std::vector<std::string>&> errMessages);
320 
321 } // namespace armnn
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
Adds a pooling layer to the network.
Definition: Network.cpp:1237
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:1310
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr) override
Adds an L2 normalization layer to the network.
Definition: Network.cpp:1356
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:290
IConnectableLayer * AddResizeBilinearLayer(const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Adds a resize bilinear layer to the network.
Definition: Network.cpp:1332
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
Add a Mean layer to the network.
Definition: Network.cpp:1534
A ReshapeDescriptor for the ReshapeLayer.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:62
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr) override
Adds a log softmax layer to the network.
Definition: Network.cpp:1362
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:1193
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:1585
IConnectableLayer * AddFloorLayer(const char *name=nullptr) override
Adds a floor layer to the network.
Definition: Network.cpp:1395
profiling::ProfilingGuid GetGuid() const final
Definition: Network.hpp:274
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an input layer to the network.
Definition: Network.cpp:1041
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:1674
IConnectableLayer * AddMinimumLayer(const char *name=nullptr) override
Add a Minimum layer to the network.
Definition: Network.cpp:1284
Copyright (c) 2020 ARM Limited.
LayerList::const_iterator Iterator
Definition: Graph.hpp:50
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:1086
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:824
IConnectableLayer * AddRsqrtLayer(const char *name=nullptr) override
Add Reciprocal of square root layer to the network.
Definition: Network.cpp:1570
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
DataLayout::NHWC false
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:1565
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:1139
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:1595
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:1377
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr) override
Adds a transpose layer to the network.
Definition: Network.cpp:1617
IConnectableLayer * AddMergeLayer(const char *name=nullptr) override
Adds a merge layer to the network.
Definition: Network.cpp:1580
IConnectableLayer * AddMaximumLayer(const char *name=nullptr) override
Add a Maximum layer to the network.
Definition: Network.cpp:1279
An LstmDescriptor for the LstmLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:43
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:1111
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:1539
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:1630
A StandInDescriptor for the StandIn layer.
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
Adds an activation layer to the network.
Definition: Network.cpp:1243
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr) override
Adds a subtraction layer to the network.
Definition: Network.cpp:1529
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
Adds an instance normalization layer to the network.
Definition: Network.cpp:1350
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr) override
Adds a depth to space layer to the network.
Definition: Network.cpp:1187
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:1623
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:1273
Status PrintGraph() override
Definition: Network.cpp:1035
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
Adds a space to depth layer to the network.
Definition: Network.cpp:1389
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:1590
bool IsWarningOnly() const
Definition: Network.hpp:300
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr) override
Add a quantize layer to the network.
Definition: Network.cpp:1544
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
Adds an ArgMinMax layer to the network.
Definition: Network.cpp:1249
OptimizationResult AssignBackends(OptimizedNetwork *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:269
profiling::ProfilingGuid GetGuid() const final
Definition: Network.hpp:38
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:82
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:1315
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Adds a batch to space ND layer to the network.
Definition: Network.cpp:1046
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition: Network.cpp:409
IConnectableLayer * AddAdditionLayer(const char *name=nullptr) override
Adds an addition layer to the network.
Definition: Network.cpp:1300
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr) override
Adds a Dequantize layer to the network.
Definition: Network.cpp:1549
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Adds a space to batch layer to the network.
Definition: Network.cpp:1383
IConnectableLayer * AddAbsLayer(const char *name=nullptr) override
Add absolute layer to the network.
Definition: Network.cpp:1295
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:1262
IConnectableLayer * AddGreaterLayer(const char *name=nullptr) override
Add a Greater layer to the network.
Definition: Network.cpp:1560
IConnectableLayer * AddMergerLayer(const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
Adds a concat layer to the network.
Definition: Network.cpp:1289
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
Adds a resize layer to the network.
Definition: Network.cpp:1344
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:1368
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:1305
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1052
#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:1255
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:1231
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1575
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Adds a softmax layer to the network.
Definition: Network.cpp:1267
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
Add a Lstm layer to the network.
Definition: Network.cpp:1400
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:1058
IConnectableLayer * AddDivisionLayer(const char *name=nullptr) override
Adds a division layer to the network.
Definition: Network.cpp:1524
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Adds a strided slice layer to the network.
Definition: Network.cpp:1554
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:1636
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
Adds a Detection PostProcess layer to the network.
Definition: Network.cpp:1221
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:305
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 })