ArmNN
 24.08
Network.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 #include <armnn/INetwork.hpp>
9 #include <armnn/LstmParams.hpp>
11 #include <armnn/TensorFwd.hpp>
12 #include <armnn/Types.hpp>
13 
14 #include <Graph.hpp>
15 #include <Layer.hpp>
16 #include <OptimizedNetworkImpl.hpp>
18 
19 #include <string>
20 #include <vector>
21 #include <map>
22 #include <memory>
23 
24 namespace armnn
25 {
26 
27 class Graph;
28 
29 using NetworkImplPtr = std::unique_ptr<NetworkImpl, void (*)(NetworkImpl* network)>;
30 
31 /// Private implementation of INetwork.
33 {
34 public:
35  NetworkImpl(const NetworkOptions& networkOptions = {});
36  ~NetworkImpl();
37 
38  const Graph& GetGraph() const
39  { return *m_Graph; }
40 
42 
43  IConnectableLayer* AddInputLayer(LayerBindingId id, const char* name = nullptr);
44 
45  IConnectableLayer* AddActivationLayer(const ActivationDescriptor& activationDescriptor,
46  const char* name = nullptr);
47  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
48  IConnectableLayer* AddAdditionLayer(const char* name = nullptr);
49 
51  const char* name = nullptr);
52 
54  const char* name = nullptr);
55 
57  const ConstTensor& mean,
58  const ConstTensor& variance,
59  const ConstTensor& beta,
60  const ConstTensor& gamma,
61  const char* name = nullptr);
62 
63  IConnectableLayer* AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
64  const char* name = nullptr);
65 
67  const char* name = nullptr);
68 
69  IConnectableLayer* AddCastLayer(const char* name = nullptr);
70 
71  IConnectableLayer* AddChannelShuffleLayer(const ChannelShuffleDescriptor& channelShuffleDescriptor,
72  const char* name = nullptr);
73 
74  IConnectableLayer* AddComparisonLayer(const ComparisonDescriptor& comparisonDescriptor,
75  const char* name = nullptr);
76 
77  IConnectableLayer* AddConcatLayer(const ConcatDescriptor& concatDescriptor,
78  const char* name = nullptr);
79 
80  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
81  const char* name = nullptr);
82 
83  IConnectableLayer* AddConvolution3dLayer(const Convolution3dDescriptor& convolution3dDescriptor,
84  const char* name = nullptr);
85 
86  IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr);
87 
88  IConnectableLayer* AddDepthToSpaceLayer(const DepthToSpaceDescriptor& depthToSpaceDescriptor,
89  const char* name = nullptr);
90 
92  const char* name = nullptr);
93 
94  IConnectableLayer* AddDequantizeLayer(const char* name = nullptr);
95 
97  const ConstTensor& anchors,
98  const char* name = nullptr);
99 
101  IConnectableLayer* AddDivisionLayer(const char* name = nullptr);
102 
103  IConnectableLayer* AddElementwiseBinaryLayer(const ElementwiseBinaryDescriptor& elementwiseBinaryDescriptor,
104  const char* name = nullptr);
105 
106  IConnectableLayer* AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
107  const char* name = nullptr);
108 
109  IConnectableLayer* AddMergeLayer(const char* name = nullptr);
110 
111  IConnectableLayer* AddFillLayer(const FillDescriptor& fillDescriptor,
112  const char* name = nullptr);
113 
114  IConnectableLayer* AddFloorLayer(const char* name = nullptr);
115 
116  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
117  const char* name = nullptr);
118 
119  IConnectableLayer* AddFusedLayer(const FusedDescriptor& fusedDescriptor,
120  const char* name = nullptr);
121 
122  IConnectableLayer* AddGatherLayer(const GatherDescriptor& gatherDescriptor,
123  const char* name = nullptr);
124 
125  IConnectableLayer* AddGatherNdLayer(const char* name = nullptr);
126 
128  const char* name = nullptr);
129 
131  const char* name = nullptr);
132 
133  IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
134  const char* name = nullptr);
135 
136  IConnectableLayer* AddLogicalBinaryLayer(const LogicalBinaryDescriptor& logicalBinaryDescriptor,
137  const char* name = nullptr);
138 
139  IConnectableLayer* AddLstmLayer(const LstmDescriptor& descriptor,
140  const LstmInputParams& params,
141  const char* name = nullptr);
142 
144  IConnectableLayer* AddMaximumLayer(const char* name = nullptr);
145 
146  IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr);
147 
149  IConnectableLayer* AddMinimumLayer(const char* name = nullptr);
150 
152  IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr);
153 
154  IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor,
155  const char* name = nullptr);
156 
157  IConnectableLayer* AddOutputLayer(LayerBindingId id, const char* name = nullptr);
158 
159  IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr);
160 
161  IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor,
162  const char* name = nullptr);
163 
164  IConnectableLayer* AddPooling2dLayer(const Pooling2dDescriptor& pooling2dDescriptor,
165  const char* name = nullptr);
166 
167  IConnectableLayer* AddPooling3dLayer(const Pooling3dDescriptor& pooling3dDescriptor,
168  const char* name = nullptr);
169 
170  IConnectableLayer* AddPrecompiledLayer(const PreCompiledDescriptor& preCompiledDescriptor,
171  CompiledBlobPtr compiledBlobPtr,
172  const Optional<BackendId>& backend,
173  const char* name = nullptr);
174 
175  IConnectableLayer* AddPreluLayer(const char* name = nullptr);
176 
177  IConnectableLayer* AddQuantizeLayer(const char* name = nullptr);
178 
180  const LstmInputParams& params,
181  const char* name = nullptr);
182 
184  const char* name = nullptr);
185 
186  IConnectableLayer* AddRankLayer(const char* name = nullptr);
187 
188  IConnectableLayer* AddReduceLayer(const ReduceDescriptor& reduceDescriptor,
189  const char* name = nullptr);
190 
191  IConnectableLayer* AddResizeLayer(const ResizeDescriptor& resizeDescriptor,
192  const char* name = nullptr);
193 
194  IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
195  const char* name = nullptr);
196 
197  IConnectableLayer* AddReverseV2Layer(const char* name = nullptr);
198 
199  IConnectableLayer* AddScatterNdLayer(const ScatterNdDescriptor& scatterDescriptor,
200  const char* name = nullptr);
201 
202  IConnectableLayer* AddShapeLayer(const char* name = nullptr);
203 
204  IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr);
205 
206  IConnectableLayer* AddSoftmaxLayer(const SoftmaxDescriptor& softmaxDescriptor,
207  const char* name = nullptr);
208 
209  IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor,
210  const char* name = nullptr);
211 
212  IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
213  const char* name = nullptr);
214 
215  IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
216  const char* name = nullptr);
217 
218  IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
219  const char* name = nullptr);
220 
222  const char* name = nullptr);
223 
224  IConnectableLayer* AddStridedSliceLayer(const StridedSliceDescriptor& stridedSliceDescriptor,
225  const char* name = nullptr);
226 
228  IConnectableLayer* AddSubtractionLayer(const char* name = nullptr);
229 
230  IConnectableLayer* AddSwitchLayer(const char* name = nullptr);
231 
232  IConnectableLayer* AddTileLayer(const TileDescriptor& tileDescriptor,
233  const char* name = nullptr);
234 
236  const ConstTensor& weights,
237  const Optional<ConstTensor>& biases,
238  const char* name = nullptr);
239 
240  IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
241  const char* name = nullptr);
242 
244  const LstmInputParams& params,
245  const char* name = nullptr);
246 
247  IConnectableLayer* AddConvertFp16ToFp32Layer(const char* name = nullptr);
248 
249  IConnectableLayer* AddConvertFp32ToFp16Layer(const char* name = nullptr);
250 
251  void ExecuteStrategy(IStrategy& strategy) const;
252 
253 private:
254 
255  bool GetShapeInferenceMethod();
256  bool GetAllowExpandedDims();
257  NetworkOptions m_NetworkOptions;
258 
259  std::unique_ptr<Graph> m_Graph;
260  ModelOptions m_ModelOptions;
261 };
262 
264 {
265  bool m_Warning;
266  bool m_Error;
267 
268  OptimizationResult(bool warning, bool error)
269  : m_Warning(warning), m_Error(error)
270  {}
271 
273  : OptimizationResult(false, false)
274  {}
275 
276  bool IsOk() const
277  { return !m_Warning && !m_Error; }
278  bool IsWarningOnly() const
279  { return m_Warning && !m_Error; }
280  bool IsError() const
281  { return m_Error; }
282 
283 };
284 
285 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
286 
288  struct BackendSettings& backendSettings);
289 
291  BackendsMap& backends,
292  TensorHandleFactoryRegistry& registry,
293  bool importEnabled,
294  bool exportEnabled,
295  Optional<std::vector<std::string>&> errMessages);
296 
298  BackendSettings& backendSettings,
299  Graph::Iterator& firstLayer,
300  Graph::Iterator& lastLayer,
301  Optional<std::vector<std::string>&> errMessages);
302 
303 
305  BackendSettings& backendSettings,
308  Optional<std::vector<std::string>&> errMessages);
309 
311 {
312  ~OptimizerOptionsOpaqueImpl() = default;
313 
315  : m_ReduceFp32ToFp16(false)
316  , m_Debug(false)
317  , m_DebugToFile(false)
318  , m_ReduceFp32ToBf16(false)
319  , m_shapeInferenceMethod(armnn::ShapeInferenceMethod::ValidateOnly)
320  , m_ImportEnabled(false)
321  , m_ModelOptions()
322  , m_ProfilingEnabled(false)
323  , m_ExportEnabled(false)
324  , m_AllowExpandedDims(false)
325  {
326  }
327 
328  explicit OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16,
329  bool importEnabled, ModelOptions modelOptions = {},
330  bool exportEnabled = false, bool debugToFile = false)
331  : m_ReduceFp32ToFp16(reduceFp32ToFp16)
332  , m_Debug(debug)
333  , m_DebugToFile(debugToFile)
334  , m_ReduceFp32ToBf16(reduceFp32ToBf16)
335  , m_shapeInferenceMethod(armnn::ShapeInferenceMethod::ValidateOnly)
336  , m_ImportEnabled(importEnabled)
337  , m_ModelOptions(modelOptions)
338  , m_ProfilingEnabled(false)
339  , m_ExportEnabled(exportEnabled)
340  , m_AllowExpandedDims(false)
341  {
342  }
343 
344  explicit OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16,
345  ShapeInferenceMethod shapeInferenceMethod,
346  bool importEnabled, ModelOptions modelOptions, bool exportEnabled,
347  bool debugToFile, bool allowExpandedDims)
348  : m_ReduceFp32ToFp16(reduceFp32ToFp16)
349  , m_Debug(debug)
350  , m_DebugToFile(debugToFile)
351  , m_ReduceFp32ToBf16(reduceFp32ToBf16)
352  , m_shapeInferenceMethod(shapeInferenceMethod)
353  , m_ImportEnabled(importEnabled)
354  , m_ModelOptions(modelOptions)
355  , m_ProfilingEnabled(false)
356  , m_ExportEnabled(exportEnabled)
357  , m_AllowExpandedDims(allowExpandedDims)
358  {
359  }
360 
361  /// Reduces all Fp32 operators in the model to Fp16 for faster processing.
362  /// If the first preferred backend does not have Fp16 support, this option will be disabled.
363  /// If the value of converted Fp16 is infinity, round to the closest finite Fp16 value.
364  /// @Note This feature works best if all operators of the model are in Fp32. ArmNN will add conversion layers
365  /// between layers that weren't in Fp32 in the first place or if the operator is not supported in Fp16.
366  /// The overhead of these conversions can lead to a slower overall performance if too many conversions are
367  /// required.
368  bool m_ReduceFp32ToFp16 = false;
369 
370  /// Add debug data for easier troubleshooting
371  bool m_Debug = false;
372 
373  /// Pass debug data to separate output files for easier troubleshooting
374  bool m_DebugToFile = false;
375 
376  /// @Note This feature has been replaced by enabling Fast Math in compute library backend options.
377  /// This is currently a placeholder option
378  bool m_ReduceFp32ToBf16 = false;
379 
380  /// Infer output size when not available
382 
383  /// Enable Import
384  bool m_ImportEnabled = false;
385 
386  /// Enable Model Options
388 
389  /// Enable profiling dump of the optimizer phase
390  bool m_ProfilingEnabled = false;
391 
392  /// Enable Export
393  bool m_ExportEnabled = false;
394 
395  /// When calculating tensor sizes, dimensions of size == 1 will be ignored
396  bool m_AllowExpandedDims = false;
397 };
398 
399 } // namespace armnn
armnn::NetworkImpl::AddDepthToSpaceLayer
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr)
Definition: Network.cpp:2286
armnn::BatchNormalizationDescriptor
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
Definition: Descriptors.hpp:828
armnn::NetworkImpl::AddTransposeConvolution2dLayer
IConnectableLayer * AddTransposeConvolution2dLayer(const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition: Network.cpp:2679
armnn::OptimizerOptionsOpaqueImpl::OptimizerOptionsOpaqueImpl
OptimizerOptionsOpaqueImpl()
Definition: Network.hpp:314
armnn::OptimizationResult::m_Error
bool m_Error
Definition: Network.hpp:266
armnn::NetworkImpl::AddLogicalBinaryLayer
IConnectableLayer * AddLogicalBinaryLayer(const LogicalBinaryDescriptor &logicalBinaryDescriptor, const char *name=nullptr)
Definition: Network.cpp:2900
armnn::ViewsDescriptor
A ViewsDescriptor for the SplitterLayer.
Definition: Descriptors.hpp:244
armnn::ActivationDescriptor
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
armnn::NetworkImpl::AddFullyConnectedLayer
IConnectableLayer * AddFullyConnectedLayer(const FullyConnectedDescriptor &fullyConnectedDescriptor, const char *name=nullptr)
Definition: Network.cpp:2246
armnn::BackendSettings
Definition: BackendSettings.hpp:18
armnn::FullyConnectedDescriptor
A FullyConnectedDescriptor for the FullyConnectedLayer.
Definition: Descriptors.hpp:507
armnn::NetworkImpl::AddReverseV2Layer
IConnectableLayer * AddReverseV2Layer(const char *name=nullptr)
Definition: Network.cpp:3053
armnn::OptimizationResult::IsWarningOnly
bool IsWarningOnly() const
Definition: Network.hpp:278
armnn::QLstmDescriptor
A QLstmDescriptor for the QLstmLayer.
Definition: Descriptors.hpp:1380
armnn::Optional
Definition: Optional.hpp:270
armnn::OptimizationResult::OptimizationResult
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:268
armnn::NetworkImpl::AddTransposeLayer
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2701
armnn::NetworkImpl::AddConvolution2dLayer
IConnectableLayer * AddConvolution2dLayer(const Convolution2dDescriptor &convolution2dDescriptor, const char *name=nullptr)
Definition: Network.cpp:2264
armnn::NetworkImpl::AddBroadcastToLayer
IConnectableLayer * AddBroadcastToLayer(const BroadcastToDescriptor &descriptor, const char *name=nullptr)
Definition: Network.cpp:3096
armnn::NetworkImpl::AddTileLayer
IConnectableLayer * AddTileLayer(const TileDescriptor &tileDescriptor, const char *name=nullptr)
Definition: Network.cpp:3058
armnn::Pooling3dDescriptor
A Pooling3dDescriptor for the Pooling3dLayer.
Definition: Descriptors.hpp:431
armnn::NetworkImpl::AddDivisionLayer
IConnectableLayer * AddDivisionLayer(const char *name=nullptr)
Definition: Network.cpp:2617
armnn::ResizeDescriptor
A ResizeDescriptor for the ResizeLayer.
Definition: Descriptors.hpp:985
armnn::ArgMinMaxDescriptor
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
armnn::InstanceNormalizationDescriptor
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
Definition: Descriptors.hpp:847
armnn::TensorHandleFactoryRegistry
Definition: TensorHandleFactoryRegistry.hpp:23
armnn::NetworkImpl::AddAdditionLayer
IConnectableLayer * AddAdditionLayer(const char *name=nullptr)
Definition: Network.cpp:2373
armnn::GatherDescriptor
A GatherDescriptor for the GatherLayer.
Definition: Descriptors.hpp:965
armnn::NetworkImpl::AddSplitterLayer
IConnectableLayer * AddSplitterLayer(const ViewsDescriptor &splitterDescriptor, const char *name=nullptr)
Definition: Network.cpp:2357
armnn::L2NormalizationDescriptor
A L2NormalizationDescriptor for the L2NormalizationLayer.
Definition: Descriptors.hpp:809
Graph.hpp
armnn::NormalizationDescriptor
A NormalizationDescriptor for the NormalizationLayer.
Definition: Descriptors.hpp:769
armnn::NetworkImpl::AddSubtractionLayer
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr)
Definition: Network.cpp:2622
armnn::NetworkImpl::AddStridedSliceLayer
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr)
Definition: Network.cpp:2647
armnn::ChannelShuffleDescriptor
A ChannelShuffleDescriptor for the ChannelShuffle operator.
Definition: Descriptors.hpp:1562
armnn::NetworkImpl::AddLogSoftmaxLayer
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr)
Definition: Network.cpp:2438
armnn::NetworkImpl::~NetworkImpl
~NetworkImpl()
Definition: Network.cpp:2191
armnn::NetworkImpl::AddMeanLayer
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr)
Definition: Network.cpp:2627
armnn::OptimizationResult::IsError
bool IsError() const
Definition: Network.hpp:280
armnn::NetworkImpl::AddResizeLayer
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2416
armnn::AssignBackends
OptimizationResult AssignBackends(OptimizedNetworkImpl *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > & > errMessages)
Definition: Network.cpp:1179
armnn::NetworkImpl::AddBatchMatMulLayer
IConnectableLayer * AddBatchMatMulLayer(const BatchMatMulDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:3048
armnn::Graph::Iterator
LayerList::const_iterator Iterator
Definition: Graph.hpp:53
armnn::NetworkImpl::AddLstmLayer
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2476
armnn::NetworkImpl::AddReduceLayer
IConnectableLayer * AddReduceLayer(const ReduceDescriptor &reduceDescriptor, const char *name=nullptr)
Definition: Network.cpp:2410
armnn::NetworkImpl::AddConstantLayer
IConnectableLayer * AddConstantLayer(const ConstTensor &input, const char *name=nullptr)
Definition: Network.cpp:2444
armnn::OptimizerOptionsOpaqueImpl::OptimizerOptionsOpaqueImpl
OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, ShapeInferenceMethod shapeInferenceMethod, bool importEnabled, ModelOptions modelOptions, bool exportEnabled, bool debugToFile, bool allowExpandedDims)
Definition: Network.hpp:344
armnn::SubgraphView::IConnectableLayerIterator
IConnectableLayers::iterator IConnectableLayerIterator
Definition: SubgraphView.hpp:64
armnn::StackDescriptor
A StackDescriptor for the StackLayer.
Definition: Descriptors.hpp:1251
armnn::OptimizationResult::OptimizationResult
OptimizationResult()
Definition: Network.hpp:272
armnn::NetworkImpl::AddDepthwiseConvolution2dLayer
IConnectableLayer * AddDepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const char *name=nullptr)
Definition: Network.cpp:2292
armnn::IStrategy
Definition: IStrategy.hpp:16
armnn::SelectTensorHandleStrategy
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, bool importEnabled, bool exportEnabled, Optional< std::vector< std::string > & > errMessages)
Definition: Network.cpp:1821
armnn::BoostLogSeverityMapping::error
@ error
armnn::NetworkImpl::AddComparisonLayer
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr)
Definition: Network.cpp:2222
armnn::NetworkImpl::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const
Definition: Network.cpp:3106
armnn::OptimizedNetworkImpl
Definition: OptimizedNetworkImpl.hpp:11
armnn::NetworkImpl::AddSwitchLayer
IConnectableLayer * AddSwitchLayer(const char *name=nullptr)
Definition: Network.cpp:2669
armnn::OptimizationResult
Definition: Network.hpp:263
armnn::NetworkImpl::AddSpaceToDepthLayer
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr)
Definition: Network.cpp:2465
armnn::NetworkImpl::AddFloorLayer
IConnectableLayer * AddFloorLayer(const char *name=nullptr)
Definition: Network.cpp:2471
armnn::OptimizationResult::IsOk
bool IsOk() const
Definition: Network.hpp:276
armnn::NetworkImpl::AddPermuteLayer
IConnectableLayer * AddPermuteLayer(const PermuteDescriptor &permuteDescriptor, const char *name=nullptr)
Definition: Network.cpp:2309
armnn::NetworkImpl::AddRankLayer
IConnectableLayer * AddRankLayer(const char *name=nullptr)
Definition: Network.cpp:2405
armnn::NetworkImpl::AddArgMinMaxLayer
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:2333
armnn::ElementwiseBinaryDescriptor
A ElementwiseBinaryDescriptor for the ElementwiseBinaryLayer.
Definition: Descriptors.hpp:109
armnn::CreateSupportedBackends
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition: Network.cpp:1302
armnn::NetworkImpl::AddBatchToSpaceNdLayer
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr)
Definition: Network.cpp:2206
armnn::NetworkImpl::AddPreluLayer
IConnectableLayer * AddPreluLayer(const char *name=nullptr)
Definition: Network.cpp:2674
armnn::NetworkImpl::AddUnidirectionalSequenceLstmLayer
IConnectableLayer * AddUnidirectionalSequenceLstmLayer(const UnidirectionalSequenceLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2906
TensorFwd.hpp
armnn::NetworkImpl::AddSoftmaxLayer
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr)
Definition: Network.cpp:2351
armnn::NetworkOptions
std::vector< BackendOptions > NetworkOptions
Definition: BackendOptions.hpp:16
LstmParams.hpp
armnn::FusedDescriptor
A FusedDescriptor for the FusedLayer.
Definition: Descriptors.hpp:944
armnn::NetworkImpl::AddBatchNormalizationLayer
IConnectableLayer * AddBatchNormalizationLayer(const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr)
Definition: Network.cpp:2388
INetwork.hpp
armnn::NetworkImpl::AddFillLayer
IConnectableLayer * AddFillLayer(const FillDescriptor &fillDescriptor, const char *name=nullptr)
Definition: Network.cpp:2240
armnn::PadDescriptor
A PadDescriptor for the PadLayer.
Definition: Descriptors.hpp:1196
armnn::NetworkImpl::AddGatherNdLayer
IConnectableLayer * AddGatherNdLayer(const char *name=nullptr)
Definition: Network.cpp:2659
armnn::TransposeDescriptor
A TransposeDescriptor for the TransposeLayer.
Definition: Descriptors.hpp:1490
armnn::OptimizationResult::m_Warning
bool m_Warning
Definition: Network.hpp:265
armnn::SliceDescriptor
A SliceDescriptor for the SliceLayer.
Definition: Descriptors.hpp:1228
armnn::NetworkImpl::AddStackLayer
IConnectableLayer * AddStackLayer(const StackDescriptor &stackDescriptor, const char *name=nullptr)
Definition: Network.cpp:2707
armnn::NetworkImpl::AddElementwiseUnaryLayer
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr)
Definition: Network.cpp:2234
armnn::ReshapeDescriptor
A ReshapeDescriptor for the ReshapeLayer.
Definition: Descriptors.hpp:1023
armnn::NetworkImpl::AddConvertFp16ToFp32Layer
IConnectableLayer * AddConvertFp16ToFp32Layer(const char *name=nullptr)
Definition: Network.cpp:2270
armnn::NetworkImpl::AddOutputLayer
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr)
Definition: Network.cpp:2383
armnn::LayerBindingId
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:309
armnn::NetworkImpl::AddReshapeLayer
IConnectableLayer * AddReshapeLayer(const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2453
armnn::NetworkImpl::AddQLstmLayer
IConnectableLayer * AddQLstmLayer(const QLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2758
armnn::NetworkImpl::PrintGraph
Status PrintGraph()
Definition: Network.cpp:2195
armnn::NetworkImpl::AddScatterNdLayer
IConnectableLayer * AddScatterNdLayer(const ScatterNdDescriptor &scatterDescriptor, const char *name=nullptr)
Definition: Network.cpp:3101
armnn::NetworkImpl::AddInputLayer
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr)
Definition: Network.cpp:2201
armnn::NetworkImpl::GetGraph
const Graph & GetGraph() const
Definition: Network.hpp:38
armnn::PermuteDescriptor
A PermuteDescriptor for the PermuteLayer.
Definition: Descriptors.hpp:149
armnn::BatchMatMulDescriptor
A BatchMatMulDescriptor for the BatchMatMul operator.
Definition: Descriptors.hpp:1584
DescriptorsFwd.hpp
armnn::NetworkImpl::AddMinimumLayer
IConnectableLayer * AddMinimumLayer(const char *name=nullptr)
Definition: Network.cpp:2368
armnn::NetworkImpl::AddElementwiseBinaryLayer
IConnectableLayer * AddElementwiseBinaryLayer(const ElementwiseBinaryDescriptor &elementwiseBinaryDescriptor, const char *name=nullptr)
Definition: Network.cpp:2228
armnn::SpaceToBatchNdDescriptor
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
Definition: Descriptors.hpp:1043
armnn::Convolution3dDescriptor
A Convolution3dDescriptor for the Convolution3dLayer.
Definition: Descriptors.hpp:588
armnn::NetworkImpl::AddQuantizeLayer
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr)
Definition: Network.cpp:2637
armnn::NetworkImpl::AddNormalizationLayer
IConnectableLayer * AddNormalizationLayer(const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr)
Definition: Network.cpp:2339
armnn::NetworkImpl
Private implementation of INetwork.
Definition: Network.hpp:32
armnn::NetworkImpl::AddMergeLayer
IConnectableLayer * AddMergeLayer(const char *name=nullptr)
Definition: Network.cpp:2664
armnn::NetworkImplPtr
std::unique_ptr< NetworkImpl, void(*)(NetworkImpl *network)> NetworkImplPtr
Definition: Network.hpp:29
armnn::NetworkImpl::AddShapeLayer
IConnectableLayer * AddShapeLayer(const char *name=nullptr)
Definition: Network.cpp:2421
armnn::OptimizerOptionsOpaqueImpl::OptimizerOptionsOpaqueImpl
OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, bool importEnabled, ModelOptions modelOptions={}, bool exportEnabled=false, bool debugToFile=false)
Definition: Network.hpp:328
armnn::NetworkImpl::AddConcatLayer
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr)
Definition: Network.cpp:2258
armnn::NetworkImpl::AddCastLayer
IConnectableLayer * AddCastLayer(const char *name=nullptr)
Definition: Network.cpp:2212
armnn::ShapeInferenceMethod::ValidateOnly
@ ValidateOnly
Validate all output shapes.
armnn::BatchToSpaceNdDescriptor
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
Definition: Descriptors.hpp:875
armnn::Convolution2dDescriptor
A Convolution2dDescriptor for the Convolution2dLayer.
Definition: Descriptors.hpp:534
armnn::NetworkImpl::AddFusedLayer
IConnectableLayer * AddFusedLayer(const FusedDescriptor &fusedDescriptor, const char *name=nullptr)
Definition: Network.cpp:2252
armnn::NetworkImpl::AddStandInLayer
IConnectableLayer * AddStandInLayer(const StandInDescriptor &descriptor, const char *name=nullptr)
Definition: Network.cpp:2714
armnn::ComparisonDescriptor
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
armnn::FillDescriptor
A FillDescriptor for the FillLayer.
Definition: Descriptors.hpp:925
armnn::NetworkImpl::AddQuantizedLstmLayer
IConnectableLayer * AddQuantizedLstmLayer(const QuantizedLstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2720
armnn::StandInDescriptor
A StandInDescriptor for the StandIn layer.
Definition: Descriptors.hpp:1281
SubgraphView.hpp
armnn::NetworkImpl::AddDequantizeLayer
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr)
Definition: Network.cpp:2642
armnn::LstmDescriptor
An LstmDescriptor for the LstmLayer.
Definition: Descriptors.hpp:1102
armnn::StridedSliceDescriptor
A StridedSliceDescriptor for the StridedSliceLayer.
Definition: Descriptors.hpp:1303
armnn::Status
Status
Definition: Types.hpp:42
OptimizedNetworkImpl.hpp
armnn::LogicalBinaryDescriptor
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
Definition: Descriptors.hpp:1518
armnn::BoostLogSeverityMapping::debug
@ debug
std
Definition: BackendId.hpp:149
ARMNN_DEPRECATED_MSG_REMOVAL_DATE
#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release)
Definition: Deprecated.hpp:44
armnn::BackendId
Definition: BackendId.hpp:75
armnn::NetworkImpl::AddL2NormalizationLayer
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:2432
armnn::NetworkImpl::AddActivationLayer
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr)
Definition: Network.cpp:2327
armnn::OriginsDescriptor
An OriginsDescriptor for the ConcatLayer.
Definition: Descriptors.hpp:201
armnn::BackendsMap
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:285
armnn::NetworkImpl::AddPooling3dLayer
IConnectableLayer * AddPooling3dLayer(const Pooling3dDescriptor &pooling3dDescriptor, const char *name=nullptr)
Definition: Network.cpp:2321
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::ElementwiseUnaryDescriptor
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:129
armnn::TransposeConvolution2dDescriptor
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
Definition: Descriptors.hpp:1440
Types.hpp
Layer.hpp
armnn::NetworkImpl::AddPooling2dLayer
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr)
Definition: Network.cpp:2315
QuantizedLstmParams.hpp
armnn::BoostLogSeverityMapping::warning
@ warning
armnn::ConstTensor
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:329
armnn::IConnectableLayer
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:80
armnn::NetworkImpl::AddMultiplicationLayer
IConnectableLayer * AddMultiplicationLayer(const char *name=nullptr)
Definition: Network.cpp:2378
armnn::ModelOptions
std::vector< BackendOptions > ModelOptions
Definition: BackendOptions.hpp:18
armnn::DetectionPostProcessDescriptor
Definition: Descriptors.hpp:713
armnn::PreCompiledDescriptor
A PreCompiledDescriptor for the PreCompiledLayer.
Definition: Descriptors.hpp:1367
armnn::NetworkImpl::AddConvertFp32ToFp16Layer
IConnectableLayer * AddConvertFp32ToFp16Layer(const char *name=nullptr)
Definition: Network.cpp:2275
armnn::NetworkImpl::AddInstanceNormalizationLayer
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:2426
armnn::NetworkImpl::NetworkImpl
NetworkImpl(const NetworkOptions &networkOptions={})
Definition: Network.cpp:2186
armnn::NetworkImpl::AddConvolution3dLayer
IConnectableLayer * AddConvolution3dLayer(const Convolution3dDescriptor &convolution3dDescriptor, const char *name=nullptr)
Definition: Network.cpp:2280
armnn::Pooling2dDescriptor
A Pooling2dDescriptor for the Pooling2dLayer.
Definition: Descriptors.hpp:371
armnn::NetworkImpl::AddChannelShuffleLayer
IConnectableLayer * AddChannelShuffleLayer(const ChannelShuffleDescriptor &channelShuffleDescriptor, const char *name=nullptr)
Definition: Network.cpp:2216
armnn::BroadcastToDescriptor
Definition: Descriptors.hpp:1659
armnn::DepthwiseConvolution2dDescriptor
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
Definition: Descriptors.hpp:659
armnn::ShapeInferenceMethod
ShapeInferenceMethod
The ShapeInferenceMethod modify how the output shapes are treated.
Definition: Types.hpp:235
armnn::ScatterNdDescriptor
A ScatterNdDescriptor for the ScatterNdLayer.
Definition: Descriptors.hpp:1679
armnn::ReduceDescriptor
A ReduceDescriptor for the REDUCE operators.
Definition: Descriptors.hpp:1538
armnn::NetworkImpl::AddSpaceToBatchNdLayer
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr)
Definition: Network.cpp:2459
armnn::NetworkImpl::AddSliceLayer
IConnectableLayer * AddSliceLayer(const SliceDescriptor &sliceDescriptor, const char *name=nullptr)
Definition: Network.cpp:2346
armnn::OptimizerOptionsOpaqueImpl
Definition: Network.hpp:310
armnn::LstmInputParams
Definition: LstmParams.hpp:13
armnn::MeanDescriptor
A MeanDescriptor for the MeanLayer.
Definition: Descriptors.hpp:1172
armnn::QuantizedLstmInputParams
Definition: QuantizedLstmParams.hpp:13
armnn::CompiledBlobPtr
std::unique_ptr< void, CompiledBlobDeleter > CompiledBlobPtr
Definition: INetwork.hpp:343
armnn::Graph
Definition: Graph.hpp:30
armnn::NetworkImpl::AddGatherLayer
IConnectableLayer * AddGatherLayer(const GatherDescriptor &gatherDescriptor, const char *name=nullptr)
Definition: Network.cpp:2653
armnn::NetworkImpl::AddPrecompiledLayer
IConnectableLayer * AddPrecompiledLayer(const PreCompiledDescriptor &preCompiledDescriptor, CompiledBlobPtr compiledBlobPtr, const Optional< BackendId > &backend, const char *name=nullptr)
Definition: Network.cpp:3063
armnn::OptimizerOptionsOpaqueImpl::m_ModelOptions
ModelOptions m_ModelOptions
Enable Model Options.
Definition: Network.hpp:387
armnn::TileDescriptor
Definition: Descriptors.hpp:1640
armnn::NetworkImpl::AddPadLayer
IConnectableLayer * AddPadLayer(const PadDescriptor &padDescriptor, const char *name=nullptr)
Definition: Network.cpp:2632
armnn::SoftmaxDescriptor
A SoftmaxDescriptor for the SoftmaxLayer.
Definition: Descriptors.hpp:177
armnn::SpaceToDepthDescriptor
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
Definition: Descriptors.hpp:1075
armnn::NetworkImpl::AddMaximumLayer
IConnectableLayer * AddMaximumLayer(const char *name=nullptr)
Definition: Network.cpp:2363
armnn::NetworkImpl::AddDetectionPostProcessLayer
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr)
Definition: Network.cpp:2299