ArmNN
 20.08
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  void Accept(ILayerVisitor& visitor) const override;
254 
255 private:
256  IConnectableLayer* AddFullyConnectedLayerImpl(const FullyConnectedDescriptor& fullyConnectedDescriptor,
257  const ConstTensor& weights,
258  const Optional<ConstTensor>& biases,
259  const char* name);
260 
261  IConnectableLayer* AddConvolution2dLayerImpl(const Convolution2dDescriptor& convolution2dDescriptor,
262  const ConstTensor& weights,
263  const Optional<ConstTensor>& biases,
264  const char* name);
265 
266  IConnectableLayer* AddDepthwiseConvolution2dLayerImpl(
267  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
268  const ConstTensor& weights,
269  const Optional<ConstTensor>& biases,
270  const char* name);
271 
272  bool GetShapeInferenceMethod();
273  NetworkOptions m_NetworkOptions;
274 
275  std::unique_ptr<Graph> m_Graph;
276 };
277 
279 {
280 public:
281  OptimizedNetwork(std::unique_ptr<Graph> graph);
282  ~OptimizedNetwork();
283 
284  Status PrintGraph() override;
285  Status SerializeToDot(std::ostream& stream) const override;
286 
287  profiling::ProfilingGuid GetGuid() const final { return m_Guid; };
288 
289  Graph& GetGraph() { return *m_Graph; }
290 
291 private:
292  std::unique_ptr<Graph> m_Graph;
294 };
295 
296 
297 
299 {
300  bool m_Warning;
301  bool m_Error;
302 
304  : m_Warning(warning)
305  , m_Error(error)
306  {}
307 
310  {}
311 
312  bool IsOk() const { return !m_Warning && !m_Error; }
313  bool IsWarningOnly() const { return m_Warning && !m_Error; }
314  bool IsError() const { return m_Error; }
315 
316 };
317 
318 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
319 
321  struct BackendSettings& backendSettings);
322 
324  BackendsMap& backends,
325  TensorHandleFactoryRegistry& registry,
326  bool importEnabled,
327  Optional<std::vector<std::string>&> errMessages);
328 
330  BackendSettings& backendSettings,
331  Graph::Iterator& firstLayer,
332  Graph::Iterator& lastLayer,
333  Optional<std::vector<std::string>&> errMessages);
334 
335 } // namespace armnn
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
Adds a pooling layer to the network.
Definition: Network.cpp:1388
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:1461
IConnectableLayer * AddRankLayer(const char *name=nullptr) override
Adds a rank layer to the network.
Definition: Network.cpp:1483
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr) override
Adds an L2 normalization layer to the network.
Definition: Network.cpp:1514
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:303
IConnectableLayer * AddResizeBilinearLayer(const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Adds a resize bilinear layer to the network.
Definition: Network.cpp:1488
IConnectableLayer * AddFillLayer(const FillDescriptor &fillDescriptor, const char *name=nullptr) override
Add an Fill layer to the network.
Definition: Network.cpp:1209
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
Add a Mean layer to the network.
Definition: Network.cpp:1709
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:1520
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:1344
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:1767
IConnectableLayer * AddFloorLayer(const char *name=nullptr) override
Adds a floor layer to the network.
Definition: Network.cpp:1553
profiling::ProfilingGuid GetGuid() const final
Definition: Network.hpp:287
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an input layer to the network.
Definition: Network.cpp:1186
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:1998
IConnectableLayer * AddMinimumLayer(const char *name=nullptr) override
Add a Minimum layer to the network.
Definition: Network.cpp:1435
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:1856
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:1237
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
IConnectableLayer * AddRsqrtLayer(const char *name=nullptr) override
Add Reciprocal of square root layer to the network.
Definition: Network.cpp:1745
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:194
A ResizeDescriptor for the ResizeLayer.
IConnectableLayer * AddEqualLayer(const char *name=nullptr) override
Add a Equal layer to the network.
Definition: Network.cpp:1740
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:1290
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:1777
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:1535
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr) override
Adds a transpose layer to the network.
Definition: Network.cpp:1799
IConnectableLayer * AddMergeLayer(const char *name=nullptr) override
Adds a merge layer to the network.
Definition: Network.cpp:1762
IConnectableLayer * AddMaximumLayer(const char *name=nullptr) override
Add a Maximum layer to the network.
Definition: Network.cpp:1430
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:298
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
Adds a concatenation layer to the network.
Definition: Network.cpp:1262
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:1714
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:1812
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:1394
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr) override
Adds a subtraction layer to the network.
Definition: Network.cpp:1704
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
Adds an instance normalization layer to the network.
Definition: Network.cpp:1508
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr) override
Adds a depth to space layer to the network.
Definition: Network.cpp:1338
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:1805
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:1424
Status PrintGraph() override
Definition: Network.cpp:1180
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
Adds a space to depth layer to the network.
Definition: Network.cpp:1547
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:1772
bool IsWarningOnly() const
Definition: Network.hpp:313
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr) override
Add a quantize layer to the network.
Definition: Network.cpp:1719
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
Adds an ArgMinMax layer to the network.
Definition: Network.cpp:1400
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:1466
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Adds a batch to space ND layer to the network.
Definition: Network.cpp:1191
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:1451
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr) override
Adds a Dequantize layer to the network.
Definition: Network.cpp:1724
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Adds a space to batch layer to the network.
Definition: Network.cpp:1541
IConnectableLayer * AddAbsLayer(const char *name=nullptr) override
Add absolute layer to the network.
Definition: Network.cpp:1446
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:1413
IConnectableLayer * AddGreaterLayer(const char *name=nullptr) override
Add a Greater layer to the network.
Definition: Network.cpp:1735
IConnectableLayer * AddMergerLayer(const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
Adds a concat layer to the network.
Definition: Network.cpp:1440
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
Adds a resize layer to the network.
Definition: Network.cpp:1502
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:1526
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:1456
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, bool importEnabled, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:946
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1197
#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:1406
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:1382
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1750
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Adds a softmax layer to the network.
Definition: Network.cpp:1418
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
Add a Lstm layer to the network.
Definition: Network.cpp:1558
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:1203
IConnectableLayer * AddDivisionLayer(const char *name=nullptr) override
Adds a division layer to the network.
Definition: Network.cpp:1699
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Adds a strided slice layer to the network.
Definition: Network.cpp:1729
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:1818
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
Adds a Detection PostProcess layer to the network.
Definition: Network.cpp:1372
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
Network(NetworkOptions networkOptions={})
Definition: Network.cpp:1171
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:318
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 })