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;
96 "Accept function is deprecated. Use IStrategy in combination with " 97 "ExecuteStrategy instead, which is an ABI/API stable version of the " 100 virtual void Accept(ILayerVisitor& visitor)
const = 0;
104 virtual void ExecuteStrategy(
IStrategy& strategy)
const = 0;
123 : m_ReduceFp32ToFp16(false)
125 , m_ReduceFp32ToBf16(false)
127 , m_ImportEnabled(false)
129 , m_ProfilingEnabled(false)
134 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
136 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
138 , m_ImportEnabled(importEnabled)
139 , m_ModelOptions(modelOptions)
140 , m_ProfilingEnabled(
false)
142 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
150 bool importEnabled =
false,
ModelOptions modelOptions = {})
151 : m_ReduceFp32ToFp16(reduceFp32ToFp16)
153 , m_ReduceFp32ToBf16(reduceFp32ToBf16)
154 , m_shapeInferenceMethod(shapeInferenceMethod)
155 , m_ImportEnabled(importEnabled)
156 , m_ModelOptions(modelOptions)
157 , m_ProfilingEnabled(
false)
159 if (m_ReduceFp32ToFp16 && m_ReduceFp32ToBf16)
197 using INetworkPtr = std::unique_ptr<INetwork, void(*)(INetwork* network)>;
207 static void Destroy(
INetwork* network);
223 const char* name =
nullptr);
235 const char* name =
nullptr);
245 const char* name =
nullptr);
256 const char* name =
nullptr);
261 const char* name =
nullptr);
267 const char* name =
nullptr);
274 const char* name =
nullptr);
281 const char* name =
nullptr);
293 const char* name =
nullptr);
307 const char* name =
nullptr);
314 const char* name =
nullptr);
321 const char* name =
nullptr);
346 const char* name =
nullptr);
352 const char* name =
nullptr);
358 const char* name =
nullptr);
365 const char* name =
nullptr);
372 const char* name =
nullptr);
379 const char* name =
nullptr);
386 const char* name =
nullptr);
393 const char* name =
nullptr);
408 const char* name =
nullptr);
418 const char* name =
nullptr);
447 const char* name =
nullptr);
459 const char* name =
nullptr);
466 const char* name =
nullptr);
473 const char* name =
nullptr);
481 const char* name =
nullptr);
488 const char* name =
nullptr);
498 const char* name =
nullptr);
505 const char* name =
nullptr);
517 const char* name =
nullptr);
524 const char* name =
nullptr);
545 const char* name =
nullptr);
575 const char* name =
nullptr);
587 const char* name =
nullptr);
599 const char* name =
nullptr);
620 const char* name =
nullptr);
627 const char* name =
nullptr);
634 const char* name =
nullptr);
643 const char* name =
nullptr);
650 const char* name =
nullptr);
659 const char* name =
nullptr);
666 const char* name =
nullptr);
675 const char* name =
nullptr);
682 const char* name =
nullptr);
689 "Accept function is deprecated. Use IStrategy in combination with " 690 "ExecuteStrategy instead, which is an ABI/API stable version of the " 693 void Accept(ILayerVisitor& visitor)
const;
696 void ExecuteStrategy(
IStrategy& strategy)
const;
701 friend void VisitLayersTopologically(
const INetwork* inputNetwork,
IStrategy& strategy);
702 friend class TestConnectionPreservation;
705 const std::vector<BackendId>& backendPreferences,
708 Optional<std::vector<std::string>&> messages);
715 namespace experimental
717 class AsyncNetworkImpl;
731 Status SerializeToDot(std::ostream& stream)
const;
733 profiling::ProfilingGuid GetGuid()
const;
735 size_t GetNumInputs()
const;
736 size_t GetNumOutputs()
const;
745 const std::shared_ptr<IProfiler>& GetProfiler()
const;
750 friend class experimental::AsyncNetworkImpl;
756 const std::vector<BackendId>& backendPreferences,
759 Optional<std::vector<std::string>&> messages);
776 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.
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
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
bool m_ReduceFp32ToBf16
Reduces all Fp32 operators in the model to Bf16 for faster processing.
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 ResizeBilinearDescriptor for the ResizeBilinearLayer.
A StackDescriptor for the StackLayer.
bool m_ReduceFp32ToFp16
Reduces all Fp32 operators in the model to Fp16 for faster processing.
A PadDescriptor for the PadLayer.
std::unique_ptr< NetworkImpl > pNetworkImpl
An LstmDescriptor for the LstmLayer.
#define ARMNN_NO_DEPRECATE_WARN_END
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.
ArmNN performs an optimization on each model/network before it gets loaded for execution.
class ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable IStrategy instead.", "22.05") ILayerVisitor
An ActivationDescriptor for the ActivationLayer.
A SliceDescriptor for the SliceLayer.
A Convolution3dDescriptor for the Convolution3dLayer.
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)
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 ChannelShuffleDescriptor for the ChannelShuffle operator.
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...