ArmNN
 20.11
Network.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 
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(NetworkOptions networkOptions = {});
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* AddFillLayer(const FillDescriptor& fillDescriptor,
101  const char* name = nullptr) override;
102 
103  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
104  const ConstTensor& weights,
105  const Optional<ConstTensor>& biases,
106  const char* name = nullptr) override;
107 
108  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
109  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
110  const ConstTensor& weights,
111  const char* name = nullptr) override;
112 
113  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
114  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
115  const ConstTensor& weights,
116  const ConstTensor& biases,
117  const char* name = nullptr) override;
118 
119  ARMNN_DEPRECATED_MSG("This AddGatherLayer overload is deprecated")
120  IConnectableLayer* AddGatherLayer(const char* name = nullptr) override;
121 
122  IConnectableLayer* AddGatherLayer(const GatherDescriptor& gatherDescriptor,
123  const char* name = nullptr) override;
124 
125  IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor,
126  const char* name = nullptr) override;
127 
128  IConnectableLayer* AddPooling2dLayer(const Pooling2dDescriptor& pooling2dDescriptor,
129  const char* name = nullptr) override;
130 
131  IConnectableLayer* AddActivationLayer(const ActivationDescriptor& activationDescriptor,
132  const char* name = nullptr) override;
133 
134  IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor,
135  const char* name = nullptr) override;
136 
137  IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr) override;
138 
139  IConnectableLayer* AddSoftmaxLayer(const SoftmaxDescriptor& softmaxDescriptor,
140  const char* name = nullptr) override;
141 
142  IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor,
143  const char* name = nullptr) override;
144 
145  ARMNN_DEPRECATED_MSG("Use AddConcatLayer instead")
146  IConnectableLayer* AddMergerLayer(const MergerDescriptor& mergerDescriptor,
147  const char* name = nullptr) override;
148 
149  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
150  IConnectableLayer* AddAbsLayer(const char* name = nullptr) override;
151 
152  IConnectableLayer* AddAdditionLayer(const char* name = nullptr) override;
153 
154  IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr) override;
155 
157  const ConstTensor& mean,
158  const ConstTensor& variance,
159  const ConstTensor& beta,
160  const ConstTensor& gamma,
161  const char* name = nullptr) override;
162 
163  IConnectableLayer* AddRankLayer(const char* name = nullptr) override;
164 
165  ARMNN_DEPRECATED_MSG("Use AddResizeLayer instead")
167  const char* name = nullptr) override;
168 
169  IConnectableLayer* AddResizeLayer(const ResizeDescriptor& resizeDescriptor,
170  const char* name = nullptr) override;
171 
173  const char* name = nullptr) override;
174 
176  const char* name = nullptr) override;
177 
178  IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
179  const char* name = nullptr) override;
180 
181  IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr) override;
182 
183  IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
184  const char* name = nullptr) override;
185 
186  IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
187  const char* name = nullptr) override;
188 
189  IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
190  const char* name = nullptr) override;
191 
192  IConnectableLayer* AddFloorLayer(const char* name = nullptr) override;
193 
194  IConnectableLayer* AddOutputLayer(LayerBindingId id, const char* name = nullptr) override;
195 
196  IConnectableLayer* AddLstmLayer(const LstmDescriptor& descriptor,
197  const LstmInputParams& params,
198  const char* name = nullptr) override;
199 
200  IConnectableLayer* AddDivisionLayer(const char* name = nullptr) override;
201 
202  IConnectableLayer* AddSubtractionLayer(const char* name = nullptr) override;
203 
204  IConnectableLayer* AddMaximumLayer(const char* name = nullptr) override;
205 
206  IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr) override;
207 
208  IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr) override;
209 
210  IConnectableLayer* AddQuantizeLayer(const char* name = nullptr) override;
211 
212  IConnectableLayer* AddStridedSliceLayer(const StridedSliceDescriptor& stridedSliceDescriptor,
213  const char* name = nullptr) override;
214 
215  IConnectableLayer* AddMinimumLayer(const char* name = nullptr) override;
216 
217  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
218  IConnectableLayer* AddGreaterLayer(const char* name = nullptr) override;
219 
220  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
221  IConnectableLayer* AddEqualLayer(const char* name = nullptr) override;
222 
223  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
224  IConnectableLayer* AddRsqrtLayer(const char* name = nullptr) override;
225 
226  IConnectableLayer* AddMergeLayer(const char* name = nullptr) override;
227 
228  IConnectableLayer* AddSwitchLayer(const char* name = nullptr) override;
229 
230  IConnectableLayer* AddPreluLayer(const char* name = nullptr) override;
231 
233  const ConstTensor& weights,
234  const Optional<ConstTensor>& biases,
235  const char* name = nullptr) override;
236 
237  IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
238  const char* name = nullptr) override;
239 
240  IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
241  const char* name = nullptr) override;
242 
244  const char* name = nullptr) override;
245 
247  const LstmInputParams& params,
248  const char* name = nullptr) override;
249 
251  const char* name = nullptr) override;
252 
253  IConnectableLayer* AddLogicalBinaryLayer(const LogicalBinaryDescriptor& logicalBinaryDescriptor,
254  const char* name = nullptr) override;
255 
256  void Accept(ILayerVisitor& visitor) const override;
257 
258 private:
259  IConnectableLayer* AddFullyConnectedLayerImpl(const FullyConnectedDescriptor& fullyConnectedDescriptor,
260  const ConstTensor& weights,
261  const Optional<ConstTensor>& biases,
262  const char* name);
263 
264  IConnectableLayer* AddConvolution2dLayerImpl(const Convolution2dDescriptor& convolution2dDescriptor,
265  const ConstTensor& weights,
266  const Optional<ConstTensor>& biases,
267  const char* name);
268 
269  IConnectableLayer* AddDepthwiseConvolution2dLayerImpl(
270  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
271  const ConstTensor& weights,
272  const Optional<ConstTensor>& biases,
273  const char* name);
274 
275  bool GetShapeInferenceMethod();
276  NetworkOptions m_NetworkOptions;
277 
278  std::unique_ptr<Graph> m_Graph;
279  ModelOptions m_ModelOptions;
280 };
281 
283 {
284 public:
285  OptimizedNetwork(std::unique_ptr<Graph> graph);
286  OptimizedNetwork(std::unique_ptr<Graph> graph, const ModelOptions& modelOptions);
287  ~OptimizedNetwork();
288 
289  Status PrintGraph() override;
290  Status SerializeToDot(std::ostream& stream) const override;
291 
292  profiling::ProfilingGuid GetGuid() const final { return m_Guid; };
293 
294  Graph& GetGraph() { return *m_Graph; }
295  ModelOptions& GetModelOptions() { return m_ModelOptions; }
296 
297 private:
298  std::unique_ptr<Graph> m_Graph;
300  ModelOptions m_ModelOptions;
301 };
302 
303 
304 
306 {
307  bool m_Warning;
308  bool m_Error;
309 
311  : m_Warning(warning)
312  , m_Error(error)
313  {}
314 
317  {}
318 
319  bool IsOk() const { return !m_Warning && !m_Error; }
320  bool IsWarningOnly() const { return m_Warning && !m_Error; }
321  bool IsError() const { return m_Error; }
322 
323 };
324 
325 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
326 
328  struct BackendSettings& backendSettings);
329 
331  BackendsMap& backends,
332  TensorHandleFactoryRegistry& registry,
333  bool importEnabled,
334  Optional<std::vector<std::string>&> errMessages);
335 
337  BackendSettings& backendSettings,
338  Graph::Iterator& firstLayer,
339  Graph::Iterator& lastLayer,
340  Optional<std::vector<std::string>&> errMessages);
341 
342 } // namespace armnn
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
Adds a pooling layer to the network.
Definition: Network.cpp:1394
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:1467
IConnectableLayer * AddRankLayer(const char *name=nullptr) override
Adds a rank layer to the network.
Definition: Network.cpp:1489
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr) override
Adds an L2 normalization layer to the network.
Definition: Network.cpp:1520
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:310
IConnectableLayer * AddResizeBilinearLayer(const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Adds a resize bilinear layer to the network.
Definition: Network.cpp:1494
IConnectableLayer * AddFillLayer(const FillDescriptor &fillDescriptor, const char *name=nullptr) override
Add an Fill layer to the network.
Definition: Network.cpp:1215
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
Add a Mean layer to the network.
Definition: Network.cpp:1715
A ReshapeDescriptor for the ReshapeLayer.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:73
DataLayout::NCHW false
std::vector< BackendOptions > ModelOptions
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr) override
Adds a log softmax layer to the network.
Definition: Network.cpp:1526
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:1350
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:1773
IConnectableLayer * AddFloorLayer(const char *name=nullptr) override
Adds a floor layer to the network.
Definition: Network.cpp:1559
profiling::ProfilingGuid GetGuid() const final
Definition: Network.hpp:292
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an input layer to the network.
Definition: Network.cpp:1192
ModelOptions & GetModelOptions()
Definition: Network.hpp:295
Main network class which provides the interface for building up a neural network. ...
Definition: INetwork.hpp:105
std::vector< BackendOptions > NetworkOptions
void Accept(ILayerVisitor &visitor) const override
Definition: Network.cpp:2010
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
IConnectableLayer * AddMinimumLayer(const char *name=nullptr) override
Add a Minimum layer to the network.
Definition: Network.cpp:1441
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:1862
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:1243
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
IConnectableLayer * AddRsqrtLayer(const char *name=nullptr) override
Add Reciprocal of square root layer to the network.
Definition: Network.cpp:1751
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:202
A ResizeDescriptor for the ResizeLayer.
IConnectableLayer * AddEqualLayer(const char *name=nullptr) override
Add a Equal layer to the network.
Definition: Network.cpp:1746
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:1296
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:1783
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:1541
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr) override
Adds a transpose layer to the network.
Definition: Network.cpp:1805
IConnectableLayer * AddMergeLayer(const char *name=nullptr) override
Adds a merge layer to the network.
Definition: Network.cpp:1768
IConnectableLayer * AddMaximumLayer(const char *name=nullptr) override
Add a Maximum layer to the network.
Definition: Network.cpp:1436
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:314
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
Adds a concatenation layer to the network.
Definition: Network.cpp:1268
A GatherDescriptor for the GatherLayer.
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:1720
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:1818
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:1400
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr) override
Adds a subtraction layer to the network.
Definition: Network.cpp:1710
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
Adds an instance normalization layer to the network.
Definition: Network.cpp:1514
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr) override
Adds a depth to space layer to the network.
Definition: Network.cpp:1344
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:1811
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:1430
Status PrintGraph() override
Definition: Network.cpp:1186
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
Adds a space to depth layer to the network.
Definition: Network.cpp:1553
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:1778
bool IsWarningOnly() const
Definition: Network.hpp:320
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr) override
Add a quantize layer to the network.
Definition: Network.cpp:1725
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
Adds an ArgMinMax layer to the network.
Definition: Network.cpp:1406
OptimizationResult AssignBackends(OptimizedNetwork *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:378
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:93
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:1472
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Adds a batch to space ND layer to the network.
Definition: Network.cpp:1197
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition: Network.cpp:518
IConnectableLayer * AddAdditionLayer(const char *name=nullptr) override
Adds an addition layer to the network.
Definition: Network.cpp:1457
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr) override
Adds a Dequantize layer to the network.
Definition: Network.cpp:1730
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Adds a space to batch layer to the network.
Definition: Network.cpp:1547
IConnectableLayer * AddLogicalBinaryLayer(const LogicalBinaryDescriptor &logicalBinaryDescriptor, const char *name=nullptr) override
Adds a Logical Binary layer to the network.
Definition: Network.cpp:2004
IConnectableLayer * AddAbsLayer(const char *name=nullptr) override
Add absolute layer to the network.
Definition: Network.cpp:1452
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:1419
IConnectableLayer * AddGreaterLayer(const char *name=nullptr) override
Add a Greater layer to the network.
Definition: Network.cpp:1741
IConnectableLayer * AddMergerLayer(const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
Adds a concat layer to the network.
Definition: Network.cpp:1446
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
Adds a resize layer to the network.
Definition: Network.cpp:1508
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:1532
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:1462
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, bool importEnabled, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:943
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1203
#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:1412
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:1388
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1756
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Adds a softmax layer to the network.
Definition: Network.cpp:1424
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
Add a Lstm layer to the network.
Definition: Network.cpp:1564
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:1209
IConnectableLayer * AddDivisionLayer(const char *name=nullptr) override
Adds a division layer to the network.
Definition: Network.cpp:1705
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Adds a strided slice layer to the network.
Definition: Network.cpp:1735
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:1824
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
Adds a Detection PostProcess layer to the network.
Definition: Network.cpp:1378
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
Network(NetworkOptions networkOptions={})
Definition: Network.cpp:1177
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:325
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 })