41 virtual unsigned int GetNumConnections()
const = 0;
45 virtual void SetTensorInfo(
const TensorInfo& tensorInfo) = 0;
47 virtual bool IsTensorInfoSet()
const = 0;
52 virtual unsigned int CalculateIndexOnOwner()
const = 0;
54 virtual LayerGuid GetOwningLayerGuid()
const = 0;
66 virtual const char* GetName()
const = 0;
69 virtual unsigned int GetNumInputSlots()
const = 0;
72 virtual unsigned int GetNumOutputSlots()
const = 0;
75 virtual const IInputSlot& GetInputSlot(
unsigned int index)
const = 0;
78 virtual IInputSlot& GetInputSlot(
unsigned int index) = 0;
81 virtual const IOutputSlot& GetOutputSlot(
unsigned int index)
const = 0;
84 virtual IOutputSlot& GetOutputSlot(
unsigned int index) = 0;
87 virtual std::vector<TensorShape> InferOutputShapes(
const std::vector<TensorShape>& inputShapes)
const = 0;
96 virtual void ExecuteStrategy(
IStrategy& strategy)
const = 0;
113 : m_ReduceFp32ToFp16(
false)
115 , m_ReduceFp32ToBf16(
false)
117 , m_ImportEnabled(
false)
123 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
125 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
127 , m_ImportEnabled(importEnabled)
128 , m_ModelOptions(modelOptions)
130 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
138 bool importEnabled =
false,
ModelOptions modelOptions = {})
139 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
141 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
142 , m_shapeInferenceMethod(shapeInferenceMethod)
143 , m_ImportEnabled(importEnabled)
144 , m_ModelOptions(modelOptions)
146 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
173 using INetworkPtr = std::unique_ptr<INetwork, void(*)(INetwork* network)>;
183 static void Destroy(
INetwork* network);
199 const char* name =
nullptr);
206 const char* name =
nullptr);
216 const char* name =
nullptr);
227 const char* name =
nullptr);
232 const char* name =
nullptr);
238 const char* name =
nullptr);
245 const char* name =
nullptr);
257 const char* name =
nullptr);
263 const char* name =
nullptr);
270 const char* name =
nullptr);
284 const char* name =
nullptr);
291 const char* name =
nullptr);
298 const char* name =
nullptr);
309 const char* name =
nullptr);
314 const char* name =
nullptr);
320 const char* name =
nullptr);
327 const char* name =
nullptr);
334 const char* name =
nullptr);
341 const char* name =
nullptr);
348 const char* name =
nullptr);
355 const char* name =
nullptr);
370 const char* name =
nullptr);
380 const char* name =
nullptr);
396 const char* name =
nullptr);
426 const char* name =
nullptr);
439 const char* name =
nullptr);
446 const char* name =
nullptr);
453 const char* name =
nullptr);
460 const char* name =
nullptr);
468 const char* name =
nullptr);
475 const char* name =
nullptr);
485 const char* name =
nullptr);
492 const char* name =
nullptr);
499 const char* name =
nullptr);
506 const char* name =
nullptr);
527 const char* name =
nullptr);
557 const char* name =
nullptr);
569 const char* name =
nullptr);
605 const char* name =
nullptr);
626 const char* name =
nullptr);
633 const char* name =
nullptr);
640 const char* name =
nullptr);
649 const char* name =
nullptr);
656 const char* name =
nullptr);
665 const char* name =
nullptr);
672 const char* name =
nullptr);
676 void ExecuteStrategy(
IStrategy& strategy)
const;
683 friend class TestConnectionPreservation;
686 const std::vector<BackendId>& backendPreferences,
689 Optional<std::vector<std::string>&> messages);
705 Status SerializeToDot(std::ostream& stream)
const;
718 const std::vector<BackendId>& backendPreferences,
721 Optional<std::vector<std::string>&> messages);
738 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.
TensorInfo GetInputTensorInfo(const INetwork *network)
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.
void VisitLayersTopologically(const INetwork *inputNetwork, IStrategy &visitor)
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...
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 })