40 virtual unsigned int GetNumConnections()
const = 0;
44 virtual void SetTensorInfo(
const TensorInfo& tensorInfo) = 0;
46 virtual bool IsTensorInfoSet()
const = 0;
51 virtual unsigned int CalculateIndexOnOwner()
const = 0;
53 virtual LayerGuid GetOwningLayerGuid()
const = 0;
65 virtual const char* GetName()
const = 0;
68 virtual unsigned int GetNumInputSlots()
const = 0;
71 virtual unsigned int GetNumOutputSlots()
const = 0;
74 virtual const IInputSlot& GetInputSlot(
unsigned int index)
const = 0;
77 virtual IInputSlot& GetInputSlot(
unsigned int index) = 0;
80 virtual const IOutputSlot& GetOutputSlot(
unsigned int index)
const = 0;
83 virtual IOutputSlot& GetOutputSlot(
unsigned int index) = 0;
86 virtual std::vector<TensorShape> InferOutputShapes(
const std::vector<TensorShape>& inputShapes)
const = 0;
95 virtual void ExecuteStrategy(
IStrategy& strategy)
const = 0;
112 : m_ReduceFp32ToFp16(false)
114 , m_ReduceFp32ToBf16(false)
116 , m_ImportEnabled(false)
122 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
124 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
126 , m_ImportEnabled(importEnabled)
127 , m_ModelOptions(modelOptions)
129 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
137 bool importEnabled =
false,
ModelOptions modelOptions = {})
138 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
140 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
141 , m_shapeInferenceMethod(shapeInferenceMethod)
142 , m_ImportEnabled(importEnabled)
143 , m_ModelOptions(modelOptions)
145 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
172 using INetworkPtr = std::unique_ptr<INetwork, void(*)(INetwork* network)>;
182 static void Destroy(
INetwork* network);
198 const char* name =
nullptr);
210 const char* name =
nullptr);
220 const char* name =
nullptr);
231 const char* name =
nullptr);
236 const char* name =
nullptr);
242 const char* name =
nullptr);
249 const char* name =
nullptr);
261 const char* name =
nullptr);
267 const char* name =
nullptr);
274 const char* name =
nullptr);
288 const char* name =
nullptr);
295 const char* name =
nullptr);
302 const char* name =
nullptr);
327 const char* name =
nullptr);
333 const char* name =
nullptr);
339 const char* name =
nullptr);
346 const char* name =
nullptr);
353 const char* name =
nullptr);
360 const char* name =
nullptr);
367 const char* name =
nullptr);
374 const char* name =
nullptr);
389 const char* name =
nullptr);
399 const char* name =
nullptr);
415 const char* name =
nullptr);
445 const char* name =
nullptr);
458 const char* name =
nullptr);
465 const char* name =
nullptr);
472 const char* name =
nullptr);
479 const char* name =
nullptr);
487 const char* name =
nullptr);
494 const char* name =
nullptr);
504 const char* name =
nullptr);
511 const char* name =
nullptr);
523 const char* name =
nullptr);
530 const char* name =
nullptr);
551 const char* name =
nullptr);
581 const char* name =
nullptr);
593 const char* name =
nullptr);
629 const char* name =
nullptr);
650 const char* name =
nullptr);
657 const char* name =
nullptr);
664 const char* name =
nullptr);
673 const char* name =
nullptr);
680 const char* name =
nullptr);
689 const char* name =
nullptr);
696 const char* name =
nullptr);
705 const char* name =
nullptr);
709 void ExecuteStrategy(
IStrategy& strategy)
const;
714 friend void VisitLayersTopologically(
const INetwork* inputNetwork,
IStrategy& strategy);
715 friend class TestConnectionPreservation;
718 const std::vector<BackendId>& backendPreferences,
721 Optional<std::vector<std::string>&> messages);
728 namespace experimental
730 class AsyncNetworkImpl;
743 Status SerializeToDot(std::ostream& stream)
const;
745 profiling::ProfilingGuid GetGuid()
const;
757 friend class experimental::AsyncNetworkImpl;
763 const std::vector<BackendId>& backendPreferences,
766 Optional<std::vector<std::string>&> messages);
783 const std::vector<BackendId>& backendPreferences,
ModelOptions m_ModelOptions
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
ShapeInferenceMethod m_shapeInferenceMethod
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
~IConnectableLayer()
Objects are not deletable via the handle.
A ReshapeDescriptor for the ReshapeLayer.
A ComparisonDescriptor for the ComparisonLayer.
std::vector< BackendOptions > ModelOptions
A Convolution2dDescriptor for the Convolution2dLayer.
Main network class which provides the interface for building up a neural network. ...
std::vector< BackendOptions > NetworkOptions
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
Copyright (c) 2021 ARM Limited and Contributors.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
Private implementation of INetwork.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
A ResizeDescriptor for the ResizeLayer.
A StackDescriptor for the StackLayer.
A PadDescriptor for the PadLayer.
std::unique_ptr< NetworkImpl > pNetworkImpl
An LstmDescriptor for the LstmLayer.
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Create an optimized version of the network.
An output connection slot for a layer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Validate all output shapes.
A GatherDescriptor for the GatherLayer.
std::unique_ptr< OptimizedNetworkImpl > pOptimizedNetworkImpl
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
Device specific knowledge to be passed to the optimizer.
An ActivationDescriptor for the ActivationLayer.
A SliceDescriptor for the SliceLayer.
Graph & GetGraphForTesting(IOptimizedNetwork *optNet)
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
OptimizerOptions(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, bool importEnabled, ModelOptions modelOptions={})
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
profiling::ProfilingGuid LayerGuid
Define LayerGuid type.
A MeanDescriptor for the MeanLayer.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
ModelOptions & GetModelOptionsForTesting(IOptimizedNetwork *optNet)
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex, unsigned int toIndex)
#define ARMNN_DEPRECATED_MSG(message)
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
~IOutputSlot()
Not user deletable.
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
ShapeInferenceMethod
The ShapeInferenceMethod modify how the output shapes are treated.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
OptimizerOptions(bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16=false, ShapeInferenceMethod shapeInferenceMethod=armnn::ShapeInferenceMethod::ValidateOnly, bool importEnabled=false, ModelOptions modelOptions={})
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...