ArmNN
 25.11
Loading...
Searching...
No Matches
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>
11#include <armnn/TensorFwd.hpp>
12#include <armnn/Types.hpp>
13
14#include <Graph.hpp>
15#include <Layer.hpp>
18
19#include <string>
20#include <vector>
21#include <map>
22#include <memory>
23
24namespace armnn
25{
26
27class Graph;
28
29using NetworkImplPtr = std::unique_ptr<NetworkImpl, void (*)(NetworkImpl* network)>;
30
31/// Private implementation of INetwork.
33{
34public:
35 NetworkImpl(const NetworkOptions& networkOptions = {});
37
38 const Graph& GetGraph() const
39 { return *m_Graph; }
40
42
43 IConnectableLayer* AddInputLayer(LayerBindingId id, const char* name = nullptr);
44
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
64 const char* name = nullptr);
65
67 const char* name = nullptr);
68
69 IConnectableLayer* AddCastLayer(const char* name = nullptr);
70
72 const char* name = nullptr);
73
75 const char* name = nullptr);
76
77 IConnectableLayer* AddConcatLayer(const ConcatDescriptor& concatDescriptor,
78 const char* name = nullptr);
79
81 const char* name = nullptr);
82
84 const char* name = nullptr);
85
86 IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr);
87
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
100 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
101 IConnectableLayer* AddDivisionLayer(const char* name = nullptr);
102
104 const char* name = nullptr);
105
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
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
137 const char* name = nullptr);
138
140 const LstmInputParams& params,
141 const char* name = nullptr);
142
143 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
144 IConnectableLayer* AddMaximumLayer(const char* name = nullptr);
145
146 IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr);
147
148 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
149 IConnectableLayer* AddMinimumLayer(const char* name = nullptr);
150
151 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
152 IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr);
153
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
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
213 const char* name = nullptr);
214
216 const char* name = nullptr);
217
218 IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
219 const char* name = nullptr);
220
222 const char* name = nullptr);
223
225 const char* name = nullptr);
226
227 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use AddElementwiseBinaryLayer instead", "24.02")
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
253private:
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{
267
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
285using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
286
288 struct BackendSettings& backendSettings);
289
291 BackendsMap& backends,
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{
313
315 : m_ReduceFp32ToFp16(false)
316 , m_Debug(false)
317 , m_DebugToFile(false)
318 , m_ReduceFp32ToBf16(false)
320 , m_ImportEnabled(false)
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
397};
398
399} // namespace armnn
#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release)
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition Tensor.hpp:330
LayerList::const_iterator Iterator
Definition Graph.hpp:53
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition INetwork.hpp:81
Private implementation of INetwork.
Definition Network.hpp:33
IConnectableLayer * AddFusedLayer(const FusedDescriptor &fusedDescriptor, const char *name=nullptr)
Definition Network.cpp:2394
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr)
Definition Network.cpp:2376
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition Network.cpp:2618
IConnectableLayer * AddDivisionLayer(const char *name=nullptr)
Definition Network.cpp:2759
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr)
Definition Network.cpp:2779
IConnectableLayer * AddMergeLayer(const char *name=nullptr)
Definition Network.cpp:2806
IConnectableLayer * AddPermuteLayer(const PermuteDescriptor &permuteDescriptor, const char *name=nullptr)
Definition Network.cpp:2451
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr)
Definition Network.cpp:2607
IConnectableLayer * AddConstantLayer(const ConstTensor &input, const char *name=nullptr)
Definition Network.cpp:2586
NetworkImpl(const NetworkOptions &networkOptions={})
Definition Network.cpp:2328
IConnectableLayer * AddLogicalBinaryLayer(const LogicalBinaryDescriptor &logicalBinaryDescriptor, const char *name=nullptr)
Definition Network.cpp:3042
IConnectableLayer * AddConvertFp16ToFp32Layer(const char *name=nullptr)
Definition Network.cpp:2412
IConnectableLayer * AddRankLayer(const char *name=nullptr)
Definition Network.cpp:2547
IConnectableLayer * AddSwitchLayer(const char *name=nullptr)
Definition Network.cpp:2811
IConnectableLayer * AddQLstmLayer(const QLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition Network.cpp:2900
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr)
Definition Network.cpp:2493
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr)
Definition Network.cpp:2784
IConnectableLayer * AddBroadcastToLayer(const BroadcastToDescriptor &descriptor, const char *name=nullptr)
Definition Network.cpp:3238
IConnectableLayer * AddConvolution2dLayer(const Convolution2dDescriptor &convolution2dDescriptor, const char *name=nullptr)
Definition Network.cpp:2406
IConnectableLayer * AddAdditionLayer(const char *name=nullptr)
Definition Network.cpp:2515
IConnectableLayer * AddQuantizedLstmLayer(const QuantizedLstmInputParams &params, const char *name=nullptr)
Definition Network.cpp:2862
IConnectableLayer * AddTransposeConvolution2dLayer(const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition Network.cpp:2821
IConnectableLayer * AddFloorLayer(const char *name=nullptr)
Definition Network.cpp:2613
IConnectableLayer * AddConvolution3dLayer(const Convolution3dDescriptor &convolution3dDescriptor, const char *name=nullptr)
Definition Network.cpp:2422
IConnectableLayer * AddStackLayer(const StackDescriptor &stackDescriptor, const char *name=nullptr)
Definition Network.cpp:2849
IConnectableLayer * AddFullyConnectedLayer(const FullyConnectedDescriptor &fullyConnectedDescriptor, const char *name=nullptr)
Definition Network.cpp:2388
IConnectableLayer * AddMinimumLayer(const char *name=nullptr)
Definition Network.cpp:2510
IConnectableLayer * AddMaximumLayer(const char *name=nullptr)
Definition Network.cpp:2505
IConnectableLayer * AddChannelShuffleLayer(const ChannelShuffleDescriptor &channelShuffleDescriptor, const char *name=nullptr)
Definition Network.cpp:2358
IConnectableLayer * AddNormalizationLayer(const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr)
Definition Network.cpp:2481
IConnectableLayer * AddPreluLayer(const char *name=nullptr)
Definition Network.cpp:2816
IConnectableLayer * AddPadLayer(const PadDescriptor &padDescriptor, const char *name=nullptr)
Definition Network.cpp:2774
IConnectableLayer * AddSplitterLayer(const ViewsDescriptor &splitterDescriptor, const char *name=nullptr)
Definition Network.cpp:2499
void ExecuteStrategy(IStrategy &strategy) const
Definition Network.cpp:3248
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr)
Definition Network.cpp:2601
IConnectableLayer * AddCastLayer(const char *name=nullptr)
Definition Network.cpp:2354
IConnectableLayer * AddStandInLayer(const StandInDescriptor &descriptor, const char *name=nullptr)
Definition Network.cpp:2856
IConnectableLayer * AddScatterNdLayer(const ScatterNdDescriptor &scatterDescriptor, const char *name=nullptr)
Definition Network.cpp:3243
IConnectableLayer * AddBatchMatMulLayer(const BatchMatMulDescriptor &desc, const char *name=nullptr)
Definition Network.cpp:3190
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr)
Definition Network.cpp:2580
const Graph & GetGraph() const
Definition Network.hpp:38
IConnectableLayer * AddReshapeLayer(const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr)
Definition Network.cpp:2595
IConnectableLayer * AddSliceLayer(const SliceDescriptor &sliceDescriptor, const char *name=nullptr)
Definition Network.cpp:2488
IConnectableLayer * AddBatchNormalizationLayer(const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr)
Definition Network.cpp:2530
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr)
Definition Network.cpp:2348
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr)
Definition Network.cpp:2469
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr)
Definition Network.cpp:2343
IConnectableLayer * AddElementwiseBinaryLayer(const ElementwiseBinaryDescriptor &elementwiseBinaryDescriptor, const char *name=nullptr)
Definition Network.cpp:2370
IConnectableLayer * AddTileLayer(const TileDescriptor &tileDescriptor, const char *name=nullptr)
Definition Network.cpp:3200
IConnectableLayer * AddGatherLayer(const GatherDescriptor &gatherDescriptor, const char *name=nullptr)
Definition Network.cpp:2795
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr)
Definition Network.cpp:2574
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr)
Definition Network.cpp:2843
IConnectableLayer * AddConvertFp32ToFp16Layer(const char *name=nullptr)
Definition Network.cpp:2417
IConnectableLayer * AddUnidirectionalSequenceLstmLayer(const UnidirectionalSequenceLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition Network.cpp:3048
IConnectableLayer * AddMultiplicationLayer(const char *name=nullptr)
Definition Network.cpp:2520
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr)
Definition Network.cpp:2568
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr)
Definition Network.cpp:2441
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr)
Definition Network.cpp:2789
IConnectableLayer * AddDepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const char *name=nullptr)
Definition Network.cpp:2434
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr)
Definition Network.cpp:2364
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr)
Definition Network.cpp:2769
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr)
Definition Network.cpp:2558
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr)
Definition Network.cpp:2475
IConnectableLayer * AddReduceLayer(const ReduceDescriptor &reduceDescriptor, const char *name=nullptr)
Definition Network.cpp:2552
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr)
Definition Network.cpp:2457
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr)
Definition Network.cpp:2400
IConnectableLayer * AddPooling3dLayer(const Pooling3dDescriptor &pooling3dDescriptor, const char *name=nullptr)
Definition Network.cpp:2463
IConnectableLayer * AddPrecompiledLayer(const PreCompiledDescriptor &preCompiledDescriptor, CompiledBlobPtr compiledBlobPtr, const Optional< BackendId > &backend, const char *name=nullptr)
Definition Network.cpp:3205
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr)
Definition Network.cpp:2764
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr)
Definition Network.cpp:2428
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr)
Definition Network.cpp:2525
IConnectableLayer * AddReverseV2Layer(const char *name=nullptr)
Definition Network.cpp:3195
IConnectableLayer * AddGatherNdLayer(const char *name=nullptr)
Definition Network.cpp:2801
IConnectableLayer * AddShapeLayer(const char *name=nullptr)
Definition Network.cpp:2563
IConnectableLayer * AddFillLayer(const FillDescriptor &fillDescriptor, const char *name=nullptr)
Definition Network.cpp:2382
IConnectableLayers::iterator IConnectableLayerIterator
Copyright (c) 2021 ARM Limited and Contributors.
std::unique_ptr< NetworkImpl, void(*)(NetworkImpl *network)> NetworkImplPtr
Definition Network.hpp:29
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition Network.cpp:1354
std::vector< BackendOptions > NetworkOptions
std::vector< BackendOptions > ModelOptions
SpaceToDepthDescriptor DepthToSpaceDescriptor
A DepthToSpaceDescriptor for the DepthToSpaceLayer.
Status
enumeration
Definition Types.hpp:43
OriginsDescriptor ConcatDescriptor
OptimizationResult AssignBackends(OptimizedNetworkImpl *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > & > errMessages)
Definition Network.cpp:1211
std::unique_ptr< void, CompiledBlobDeleter > CompiledBlobPtr
Definition INetwork.hpp:343
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition Types.hpp:311
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, bool importEnabled, bool exportEnabled, Optional< std::vector< std::string > & > errMessages)
Definition Network.cpp:1877
SoftmaxDescriptor LogSoftmaxDescriptor
A LogSoftmaxDescriptor for the LogSoftmaxLayer.
LstmDescriptor UnidirectionalSequenceLstmDescriptor
ShapeInferenceMethod
The ShapeInferenceMethod modify how the output shapes are treated.
Definition Types.hpp:237
@ ValidateOnly
Validate all output shapes.
Definition Types.hpp:239
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition Network.hpp:285
An ActivationDescriptor for the ActivationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
A BatchMatMulDescriptor for the BatchMatMul operator.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
A ComparisonDescriptor for the ComparisonLayer.
A Convolution2dDescriptor for the Convolution2dLayer.
A Convolution3dDescriptor for the Convolution3dLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A ElementwiseBinaryDescriptor for the ElementwiseBinaryLayer.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
A FillDescriptor for the FillLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A FusedDescriptor for the FusedLayer.
A GatherDescriptor for the GatherLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
An LstmDescriptor for the LstmLayer.
A MeanDescriptor for the MeanLayer.
A NormalizationDescriptor for the NormalizationLayer.
bool IsWarningOnly() const
Definition Network.hpp:278
OptimizationResult(bool warning, bool error)
Definition Network.hpp:268
bool m_ExportEnabled
Enable Export.
Definition Network.hpp:393
bool m_ImportEnabled
Enable Import.
Definition Network.hpp:384
bool m_ReduceFp32ToBf16
@Note This feature has been replaced by enabling Fast Math in compute library backend options.
Definition Network.hpp:378
bool m_ProfilingEnabled
Enable profiling dump of the optimizer phase.
Definition Network.hpp:390
bool m_Debug
Add debug data for easier troubleshooting.
Definition Network.hpp:371
bool m_ReduceFp32ToFp16
Reduces all Fp32 operators in the model to Fp16 for faster processing.
Definition Network.hpp:368
ModelOptions m_ModelOptions
Enable Model Options.
Definition Network.hpp:387
ShapeInferenceMethod m_shapeInferenceMethod
Infer output size when not available.
Definition Network.hpp:381
bool m_AllowExpandedDims
When calculating tensor sizes, dimensions of size == 1 will be ignored.
Definition Network.hpp:396
OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, ShapeInferenceMethod shapeInferenceMethod, bool importEnabled, ModelOptions modelOptions, bool exportEnabled, bool debugToFile, bool allowExpandedDims)
Definition Network.hpp:344
OptimizerOptionsOpaqueImpl(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, bool importEnabled, ModelOptions modelOptions={}, bool exportEnabled=false, bool debugToFile=false)
Definition Network.hpp:328
bool m_DebugToFile
Pass debug data to separate output files for easier troubleshooting.
Definition Network.hpp:374
A PadDescriptor for the PadLayer.
A PermuteDescriptor for the PermuteLayer.
A Pooling2dDescriptor for the Pooling2dLayer.
A Pooling3dDescriptor for the Pooling3dLayer.
A PreCompiledDescriptor for the PreCompiledLayer.
A QLstmDescriptor for the QLstmLayer.
A ReduceDescriptor for the REDUCE operators.
A ReshapeDescriptor for the ReshapeLayer.
A ResizeDescriptor for the ResizeLayer.
A ScatterNdDescriptor for the ScatterNdLayer.
A SliceDescriptor for the SliceLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A StackDescriptor for the StackLayer.
A StandInDescriptor for the StandIn layer.
A StridedSliceDescriptor for the StridedSliceLayer.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
A TransposeDescriptor for the TransposeLayer.
A ViewsDescriptor for the SplitterLayer.