ArmNN
 21.02
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 #include "OptimizedNetworkImpl.hpp"
23 
24 namespace armnn
25 {
26 class Graph;
27 
28 using NetworkImplPtr = std::unique_ptr<NetworkImpl, void(*)(NetworkImpl* network)>;
29 
30 /// Private implementation of INetwork.
32 {
33 public:
34  NetworkImpl(NetworkOptions networkOptions = {});
35  ~NetworkImpl();
36 
37  const Graph& GetGraph() const { return *m_Graph; }
38 
40 
41  IConnectableLayer* AddInputLayer(LayerBindingId id, const char* name=nullptr);
42 
44  const char* name = nullptr);
45 
46  IConnectableLayer* AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
47  const char* name = nullptr);
48 
49  IConnectableLayer* AddComparisonLayer(const ComparisonDescriptor& comparisonDescriptor,
50  const char* name = nullptr);
51 
52  IConnectableLayer* AddConcatLayer(const ConcatDescriptor& concatDescriptor,
53  const char* name = nullptr);
54 
55  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
56  const ConstTensor& weights,
57  const Optional<ConstTensor>& biases,
58  const char* name = nullptr);
59 
60  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
61  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
62  const ConstTensor& weights,
63  const char* name = nullptr);
64 
65  ARMNN_DEPRECATED_MSG("This AddConvolution2dLayer overload is deprecated")
66  IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor,
67  const ConstTensor& weights,
68  const ConstTensor& biases,
69  const char* name = nullptr);
70 
71  IConnectableLayer* AddDepthToSpaceLayer(const DepthToSpaceDescriptor& depthToSpaceDescriptor,
72  const char* name = nullptr);
73 
75  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
76  const ConstTensor& weights,
77  const Optional<ConstTensor>& biases,
78  const char* name = nullptr);
79 
80  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
82  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
83  const ConstTensor& weights,
84  const char* name = nullptr);
85 
86  ARMNN_DEPRECATED_MSG("This AddDepthwiseConvolution2dLayer overload is deprecated")
88  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
89  const ConstTensor& weights,
90  const ConstTensor& biases,
91  const char* name = nullptr);
92 
93  IConnectableLayer* AddDequantizeLayer(const char* name = nullptr);
94 
96  const DetectionPostProcessDescriptor& descriptor,
97  const ConstTensor& anchors,
98  const char* name = nullptr);
99 
100  IConnectableLayer* AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
101  const char* name = nullptr);
102 
103  IConnectableLayer* AddFillLayer(const FillDescriptor& fillDescriptor,
104  const char* name = nullptr);
105 
106  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
107  const ConstTensor& weights,
108  const Optional<ConstTensor>& biases,
109  const char* name = nullptr);
110 
111  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
112  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
113  const ConstTensor& weights,
114  const char* name = nullptr);
115 
116  ARMNN_DEPRECATED_MSG("This AddFullyConnectedLayer overload is deprecated")
117  IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor,
118  const ConstTensor& weights,
119  const ConstTensor& biases,
120  const char* name = nullptr);
121 
122  ARMNN_DEPRECATED_MSG("This AddGatherLayer overload is deprecated")
123  IConnectableLayer* AddGatherLayer(const char* name = nullptr);
124 
125  IConnectableLayer* AddGatherLayer(const GatherDescriptor& gatherDescriptor,
126  const char* name = nullptr);
127 
128  IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor,
129  const char* name = nullptr);
130 
131  IConnectableLayer* AddPooling2dLayer(const Pooling2dDescriptor& pooling2dDescriptor,
132  const char* name = nullptr);
133 
134  IConnectableLayer* AddActivationLayer(const ActivationDescriptor& activationDescriptor,
135  const char* name = nullptr);
136 
137  IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor,
138  const char* name = nullptr);
139 
140  IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr);
141 
142  IConnectableLayer* AddSoftmaxLayer(const SoftmaxDescriptor& softmaxDescriptor,
143  const char* name = nullptr);
144 
145  IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor,
146  const char* name = nullptr);
147 
148  ARMNN_DEPRECATED_MSG("Use AddConcatLayer instead")
149  IConnectableLayer* AddMergerLayer(const MergerDescriptor& mergerDescriptor,
150  const char* name = nullptr);
151 
152  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
153  IConnectableLayer* AddAbsLayer(const char* name = nullptr);
154 
155  IConnectableLayer* AddAdditionLayer(const char* name = nullptr);
156 
157  IConnectableLayer* AddMultiplicationLayer(const char* name = nullptr);
158 
160  const ConstTensor& mean,
161  const ConstTensor& variance,
162  const ConstTensor& beta,
163  const ConstTensor& gamma,
164  const char* name = nullptr);
165 
166  IConnectableLayer* AddRankLayer(const char* name = nullptr);
167 
168  ARMNN_DEPRECATED_MSG("Use AddResizeLayer instead")
170  const char* name = nullptr);
171 
172  IConnectableLayer* AddResizeLayer(const ResizeDescriptor& resizeDescriptor,
173  const char* name = nullptr);
174 
175  IConnectableLayer* AddReduceLayer(const ReduceDescriptor& reduceDescriptor,
176  const char* name = nullptr);
177 
179  const char* name = nullptr);
180 
182  const char* name = nullptr);
183 
184  IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
185  const char* name = nullptr);
186 
187  IConnectableLayer* AddConstantLayer(const ConstTensor& input, const char* name = nullptr);
188 
189  IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
190  const char* name = nullptr);
191 
192  IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
193  const char* name = nullptr);
194 
195  IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
196  const char* name = nullptr);
197 
198  IConnectableLayer* AddFloorLayer(const char* name = nullptr);
199 
200  IConnectableLayer* AddOutputLayer(LayerBindingId id, const char* name = nullptr);
201 
202  IConnectableLayer* AddLstmLayer(const LstmDescriptor& descriptor,
203  const LstmInputParams& params,
204  const char* name = nullptr);
205 
206  IConnectableLayer* AddDivisionLayer(const char* name = nullptr);
207 
208  IConnectableLayer* AddSubtractionLayer(const char* name = nullptr);
209 
210  IConnectableLayer* AddMaximumLayer(const char* name = nullptr);
211 
212  IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr);
213 
214  IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr);
215 
216  IConnectableLayer* AddQuantizeLayer(const char* name = nullptr);
217 
218  IConnectableLayer* AddStridedSliceLayer(const StridedSliceDescriptor& stridedSliceDescriptor,
219  const char* name = nullptr);
220 
221  IConnectableLayer* AddMinimumLayer(const char* name = nullptr);
222 
223  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
224  IConnectableLayer* AddGreaterLayer(const char* name = nullptr);
225 
226  ARMNN_DEPRECATED_MSG("Use AddComparisonLayer instead")
227  IConnectableLayer* AddEqualLayer(const char* name = nullptr);
228 
229  ARMNN_DEPRECATED_MSG("Use AddElementwiseUnaryLayer instead")
230  IConnectableLayer* AddRsqrtLayer(const char* name = nullptr);
231 
232  IConnectableLayer* AddMergeLayer(const char* name = nullptr);
233 
234  IConnectableLayer* AddSwitchLayer(const char* name = nullptr);
235 
236  IConnectableLayer* AddPreluLayer(const char* name = nullptr);
237 
239  const ConstTensor& weights,
240  const Optional<ConstTensor>& biases,
241  const char* name = nullptr);
242 
243  IConnectableLayer* AddTransposeLayer(const TransposeDescriptor& transposeDescriptor,
244  const char* name = nullptr);
245 
246  IConnectableLayer* AddStackLayer(const StackDescriptor& stackDescriptor,
247  const char* name = nullptr);
248 
250  const char* name = nullptr);
251 
253  const LstmInputParams& params,
254  const char* name = nullptr);
255 
257  const char* name = nullptr);
258 
259  IConnectableLayer* AddLogicalBinaryLayer(const LogicalBinaryDescriptor& logicalBinaryDescriptor,
260  const char* name = nullptr);
261 
262  void Accept(ILayerVisitor& visitor) const;
263 
264  void ExecuteStrategy(IStrategy& strategy) const;
265 
266 private:
267  IConnectableLayer* AddFullyConnectedLayerImpl(const FullyConnectedDescriptor& fullyConnectedDescriptor,
268  const ConstTensor& weights,
269  const Optional<ConstTensor>& biases,
270  const char* name);
271 
272  IConnectableLayer* AddConvolution2dLayerImpl(const Convolution2dDescriptor& convolution2dDescriptor,
273  const ConstTensor& weights,
274  const Optional<ConstTensor>& biases,
275  const char* name);
276 
277  IConnectableLayer* AddDepthwiseConvolution2dLayerImpl(
278  const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
279  const ConstTensor& weights,
280  const Optional<ConstTensor>& biases,
281  const char* name);
282 
283  bool GetShapeInferenceMethod();
284  NetworkOptions m_NetworkOptions;
285 
286  std::unique_ptr<Graph> m_Graph;
287  ModelOptions m_ModelOptions;
288 };
289 
291 {
292  bool m_Warning;
293  bool m_Error;
294 
296  : m_Warning(warning)
297  , m_Error(error)
298  {}
299 
302  {}
303 
304  bool IsOk() const { return !m_Warning && !m_Error; }
305  bool IsWarningOnly() const { return m_Warning && !m_Error; }
306  bool IsError() const { return m_Error; }
307 
308 };
309 
310 using BackendsMap = std::map<BackendId, std::unique_ptr<class IBackendInternal>>;
311 
313  struct BackendSettings& backendSettings);
314 
316  BackendsMap& backends,
317  TensorHandleFactoryRegistry& registry,
318  bool importEnabled,
319  Optional<std::vector<std::string>&> errMessages);
320 
322  BackendSettings& backendSettings,
323  Graph::Iterator& firstLayer,
324  Graph::Iterator& lastLayer,
325  Optional<std::vector<std::string>&> errMessages);
326 
327 } // namespace armnn
IConnectableLayer * AddReduceLayer(const ReduceDescriptor &reduceDescriptor, const char *name=nullptr)
Definition: Network.cpp:1984
IConnectableLayer * AddRsqrtLayer(const char *name=nullptr)
Definition: Network.cpp:2246
OptimizationResult AssignBackends(OptimizedNetworkImpl *optNetObjPtr, BackendSettings &backendSettings, Graph::Iterator &firstLayer, Graph::Iterator &lastLayer, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:869
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:62
IConnectableLayer * AddResizeLayer(const ResizeDescriptor &resizeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2004
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
IConnectableLayer * AddQuantizeLayer(const char *name=nullptr)
Definition: Network.cpp:2220
IConnectableLayer * AddFullyConnectedLayer(const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition: Network.cpp:1733
OptimizationResult(bool warning, bool error)
Definition: Network.hpp:295
IConnectableLayer * AddRankLayer(const char *name=nullptr)
Definition: Network.cpp:1979
A ReshapeDescriptor for the ReshapeLayer.
IConnectableLayer * AddAdditionLayer(const char *name=nullptr)
Definition: Network.cpp:1947
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:78
IConnectableLayer * AddAbsLayer(const char *name=nullptr)
Definition: Network.cpp:1942
IConnectableLayer * AddPooling2dLayer(const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr)
Definition: Network.cpp:1884
NetworkImpl(NetworkOptions networkOptions={})
Definition: Network.cpp:1667
DataLayout::NCHW false
std::vector< BackendOptions > ModelOptions
IConnectableLayer * AddMergeLayer(const char *name=nullptr)
Definition: Network.cpp:2263
A Convolution2dDescriptor for the Convolution2dLayer.
IConnectableLayer * AddQuantizedLstmLayer(const QuantizedLstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2319
IConnectableLayer * AddConstantLayer(const ConstTensor &input, const char *name=nullptr)
Definition: Network.cpp:2027
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr)
Definition: Network.cpp:1699
IConnectableLayer * AddNormalizationLayer(const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr)
Definition: Network.cpp:1902
Status PrintGraph()
Definition: Network.cpp:1676
IConnectableLayer * AddMeanLayer(const MeanDescriptor &meanDescriptor, const char *name=nullptr)
Definition: Network.cpp:2210
void ExecuteStrategy(IStrategy &strategy) const
Definition: Network.cpp:2513
IConnectableLayer * AddMinimumLayer(const char *name=nullptr)
Definition: Network.cpp:1931
IConnectableLayer * AddSpaceToDepthLayer(const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr)
Definition: Network.cpp:2048
std::vector< BackendOptions > NetworkOptions
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr)
Definition: Network.cpp:1890
Copyright (c) 2021 ARM Limited and Contributors.
LayerList::const_iterator Iterator
Definition: Graph.hpp:50
IConnectableLayer * AddDepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition: Network.cpp:1840
IConnectableLayer * AddLogSoftmaxLayer(const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr)
Definition: Network.cpp:2021
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
Private implementation of INetwork.
Definition: Network.hpp:31
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:210
A ResizeDescriptor for the ResizeLayer.
A StackDescriptor for the StackLayer.
IConnectableLayer * AddMergerLayer(const MergerDescriptor &mergerDescriptor, const char *name=nullptr)
Definition: Network.cpp:1936
IConnectableLayer * AddFloorLayer(const char *name=nullptr)
Definition: Network.cpp:2054
A PadDescriptor for the PadLayer.
IConnectableLayer * AddMultiplicationLayer(const char *name=nullptr)
Definition: Network.cpp:1952
IConnectableLayer * AddQLstmLayer(const QLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2357
IConnectableLayer * AddStridedSliceLayer(const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr)
Definition: Network.cpp:2230
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr)
Definition: Network.cpp:1682
std::unique_ptr< NetworkImpl, void(*)(NetworkImpl *network)> NetworkImplPtr
Definition: Network.hpp:28
An LstmDescriptor for the LstmLayer.
IConnectableLayer * AddTransposeConvolution2dLayer(const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition: Network.cpp:2278
IConnectableLayer * AddPreluLayer(const char *name=nullptr)
Definition: Network.cpp:2273
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
IConnectableLayer * AddDetectionPostProcessLayer(const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr)
Definition: Network.cpp:1868
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:314
A GatherDescriptor for the GatherLayer.
Status
enumeration
Definition: Types.hpp:26
IConnectableLayer * AddDivisionLayer(const char *name=nullptr)
Definition: Network.cpp:2200
IConnectableLayer * AddArgMinMaxLayer(const ArgMinMaxDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:1896
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr)
Definition: Network.cpp:1957
IConnectableLayer * AddDequantizeLayer(const char *name=nullptr)
Definition: Network.cpp:2225
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr)
Definition: Network.cpp:1758
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
IConnectableLayer * AddSwitchLayer(const char *name=nullptr)
Definition: Network.cpp:2268
IConnectableLayer * AddSubtractionLayer(const char *name=nullptr)
Definition: Network.cpp:2205
IConnectableLayer * AddResizeBilinearLayer(const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr)
Definition: Network.cpp:1990
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:25
IConnectableLayer * AddLogicalBinaryLayer(const LogicalBinaryDescriptor &logicalBinaryDescriptor, const char *name=nullptr)
Definition: Network.cpp:2499
void Accept(ILayerVisitor &visitor) const
Definition: Network.cpp:2505
A SliceDescriptor for the SliceLayer.
IConnectableLayer * AddStandInLayer(const StandInDescriptor &descriptor, const char *name=nullptr)
Definition: Network.cpp:2313
IConnectableLayer * AddPermuteLayer(const PermuteDescriptor &permuteDescriptor, const char *name=nullptr)
Definition: Network.cpp:1878
IConnectableLayer * AddL2NormalizationLayer(const L2NormalizationDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:2015
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
bool IsWarningOnly() const
Definition: Network.hpp:305
IConnectableLayer * AddTransposeLayer(const TransposeDescriptor &transposeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2300
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:98
IConnectableLayer * AddReshapeLayer(const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr)
Definition: Network.cpp:2036
IConnectableLayer * AddMaximumLayer(const char *name=nullptr)
Definition: Network.cpp:1926
BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry &handleFactoryRegistry, BackendSettings &backendSettings)
Definition: Network.cpp:1009
IConnectableLayer * AddStackLayer(const StackDescriptor &stackDescriptor, const char *name=nullptr)
Definition: Network.cpp:2306
IConnectableLayer * AddSoftmaxLayer(const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr)
Definition: Network.cpp:1914
IConnectableLayer * AddGreaterLayer(const char *name=nullptr)
Definition: Network.cpp:2236
IConnectableLayer * AddEqualLayer(const char *name=nullptr)
Definition: Network.cpp:2241
IConnectableLayer * AddFillLayer(const FillDescriptor &fillDescriptor, const char *name=nullptr)
Definition: Network.cpp:1705
const Graph & GetGraph() const
Definition: Network.hpp:37
A MeanDescriptor for the MeanLayer.
IConnectableLayer * AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr)
Definition: Network.cpp:2042
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr)
Definition: Network.cpp:1693
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry &registry, bool importEnabled, Optional< std::vector< std::string > &> errMessages)
Definition: Network.cpp:1434
#define ARMNN_DEPRECATED_MSG(message)
Definition: Deprecated.hpp:43
IConnectableLayer * AddBatchNormalizationLayer(const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr)
Definition: Network.cpp:1962
IConnectableLayer * AddGatherLayer(const char *name=nullptr)
Definition: Network.cpp:2251
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
IConnectableLayer * AddDepthToSpaceLayer(const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr)
Definition: Network.cpp:1834
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
IConnectableLayer * AddConvolution2dLayer(const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr)
Definition: Network.cpp:1786
IConnectableLayer * AddSplitterLayer(const ViewsDescriptor &splitterDescriptor, const char *name=nullptr)
Definition: Network.cpp:1920
IConnectableLayer * AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr)
Definition: Network.cpp:1687
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
IConnectableLayer * AddLstmLayer(const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
Definition: Network.cpp:2059
IConnectableLayer * AddPadLayer(const PadDescriptor &padDescriptor, const char *name=nullptr)
Definition: Network.cpp:2215
A SoftmaxDescriptor for the SoftmaxLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap
Definition: Network.hpp:310
A PermuteDescriptor for the PermuteLayer.
IConnectableLayer * AddSliceLayer(const SliceDescriptor &sliceDescriptor, const char *name=nullptr)
Definition: Network.cpp:1909
IConnectableLayer * AddInstanceNormalizationLayer(const InstanceNormalizationDescriptor &desc, const char *name=nullptr)
Definition: Network.cpp:2009
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 })