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);
211 const char* name =
nullptr);
221 const char* name =
nullptr);
232 const char* name =
nullptr);
237 const char* name =
nullptr);
243 const char* name =
nullptr);
250 const char* name =
nullptr);
262 const char* name =
nullptr);
268 const char* name =
nullptr);
275 const char* name =
nullptr);
289 const char* name =
nullptr);
296 const char* name =
nullptr);
303 const char* name =
nullptr);
314 const char* name =
nullptr);
325 const char* name =
nullptr);
330 const char* name =
nullptr);
336 const char* name =
nullptr);
343 const char* name =
nullptr);
350 const char* name =
nullptr);
357 const char* name =
nullptr);
364 const char* name =
nullptr);
371 const char* name =
nullptr);
386 const char* name =
nullptr);
396 const char* name =
nullptr);
412 const char* name =
nullptr);
442 const char* name =
nullptr);
455 const char* name =
nullptr);
462 const char* name =
nullptr);
469 const char* name =
nullptr);
476 const char* name =
nullptr);
484 const char* name =
nullptr);
491 const char* name =
nullptr);
501 const char* name =
nullptr);
508 const char* name =
nullptr);
515 const char* name =
nullptr);
522 const char* name =
nullptr);
543 const char* name =
nullptr);
573 const char* name =
nullptr);
585 const char* name =
nullptr);
621 const char* name =
nullptr);
642 const char* name =
nullptr);
649 const char* name =
nullptr);
656 const char* name =
nullptr);
665 const char* name =
nullptr);
672 const char* name =
nullptr);
681 const char* name =
nullptr);
688 const char* name =
nullptr);
692 void ExecuteStrategy(
IStrategy& strategy)
const;
697 friend void VisitLayersTopologically(
const INetwork* inputNetwork,
IStrategy& strategy);
698 friend class TestConnectionPreservation;
701 const std::vector<BackendId>& backendPreferences,
704 Optional<std::vector<std::string>&> messages);
711 namespace experimental
713 class AsyncNetworkImpl;
726 Status SerializeToDot(std::ostream& stream)
const;
737 friend class experimental::AsyncNetworkImpl;
743 const std::vector<BackendId>& backendPreferences,
746 Optional<std::vector<std::string>&> messages);
763 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.
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 })