ArmNN
 22.02
IConnectableLayer Class Referenceabstract

Interface for a layer that is connectable to other layers via InputSlots and OutputSlots. More...

#include <INetwork.hpp>

Inheritance diagram for IConnectableLayer:
Layer AbsLayer BindableLayer CastLayer ConstantLayer ConvertBf16ToFp32Layer ConvertFp16ToFp32Layer ConvertFp32ToBf16Layer ConvertFp32ToFp16Layer DebugLayer DequantizeLayer ElementwiseBaseLayer FloorLayer LayerWithParameters< Parameters > MapLayer MemCopyLayer MemImportLayer MergeLayer PreluLayer QuantizedLstmLayer QuantizeLayer RankLayer RsqrtLayer ShapeLayer SwitchLayer UnmapLayer LayerWithParameters< ActivationDescriptor > LayerWithParameters< ArgMinMaxDescriptor > LayerWithParameters< BatchNormalizationDescriptor > LayerWithParameters< BatchToSpaceNdDescriptor > LayerWithParameters< ChannelShuffleDescriptor > LayerWithParameters< ComparisonDescriptor > LayerWithParameters< Convolution2dDescriptor > LayerWithParameters< Convolution3dDescriptor > LayerWithParameters< DepthToSpaceDescriptor > LayerWithParameters< DepthwiseConvolution2dDescriptor > LayerWithParameters< DetectionPostProcessDescriptor > LayerWithParameters< ElementwiseUnaryDescriptor > LayerWithParameters< FakeQuantizationDescriptor > LayerWithParameters< FillDescriptor > LayerWithParameters< FullyConnectedDescriptor > LayerWithParameters< GatherDescriptor > LayerWithParameters< InstanceNormalizationDescriptor > LayerWithParameters< L2NormalizationDescriptor > LayerWithParameters< LogicalBinaryDescriptor > LayerWithParameters< LogSoftmaxDescriptor > LayerWithParameters< LstmDescriptor > LayerWithParameters< MeanDescriptor > LayerWithParameters< NormalizationDescriptor > LayerWithParameters< OriginsDescriptor > LayerWithParameters< PadDescriptor > LayerWithParameters< PermuteDescriptor > LayerWithParameters< Pooling2dDescriptor > LayerWithParameters< Pooling3dDescriptor > LayerWithParameters< PreCompiledDescriptor > LayerWithParameters< QLstmDescriptor > LayerWithParameters< ReduceDescriptor > LayerWithParameters< ReshapeDescriptor > LayerWithParameters< ResizeDescriptor > LayerWithParameters< SliceDescriptor > LayerWithParameters< SoftmaxDescriptor > LayerWithParameters< SpaceToBatchNdDescriptor > LayerWithParameters< SpaceToDepthDescriptor > LayerWithParameters< StackDescriptor > LayerWithParameters< StandInDescriptor > LayerWithParameters< StridedSliceDescriptor > LayerWithParameters< TransposeConvolution2dDescriptor > LayerWithParameters< TransposeDescriptor > LayerWithParameters< ViewsDescriptor >

Public Types

using ConstantTensors = std::vector< std::reference_wrapper< std::shared_ptr< ConstTensorHandle > >>
 

Public Member Functions

virtual const char * GetName () const =0
 Returns the name of the layer. More...
 
virtual unsigned int GetNumInputSlots () const =0
 Returns the number of connectable input slots. More...
 
virtual unsigned int GetNumOutputSlots () const =0
 Returns the number of connectable output slots. More...
 
virtual const IInputSlotGetInputSlot (unsigned int index) const =0
 Get a const input slot handle by slot index. More...
 
virtual IInputSlotGetInputSlot (unsigned int index)=0
 Get the input slot handle by slot index. More...
 
virtual const IOutputSlotGetOutputSlot (unsigned int index) const =0
 Get the const output slot handle by slot index. More...
 
virtual IOutputSlotGetOutputSlot (unsigned int index)=0
 Get the output slot handle by slot index. More...
 
virtual std::vector< TensorShapeInferOutputShapes (const std::vector< TensorShape > &inputShapes) const =0
 Infer the shape of the output(s) based on the provided input shape(s) More...
 
virtual LayerGuid GetGuid () const =0
 Returns the unique id of the layer. More...
 
ARMNN_NO_DEPRECATE_WARN_BEGIN ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("Accept is deprecated. The ILayerVisitor that works in conjunction with this " "Accept function is deprecated. Use IStrategy in combination with " "ExecuteStrategy instead, which is an ABI/API stable version of the " "visitor pattern.", "22.05") virtual void Accept(ILayerVisitor &visitor) const =0
 Apply a visitor to this layer. More...
 
virtual ARMNN_NO_DEPRECATE_WARN_END void ExecuteStrategy (IStrategy &strategy) const =0
 Apply a visitor to this layer. More...
 
virtual void BackendSelectionHint (Optional< BackendId > backend)=0
 Provide a hint for the optimizer as to which backend to prefer for this layer. More...
 
virtual LayerType GetType () const =0
 Returns the armnn::LayerType of this layer. More...
 
virtual const BaseDescriptorGetParameters () const =0
 If the layer has a descriptor return it. More...
 
virtual ConstantTensors GetConstantTensorsByRef ()=0
 

Protected Member Functions

 ~IConnectableLayer ()
 Objects are not deletable via the handle. More...
 

Detailed Description

Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.

Examples:
AsyncExecutionSample.cpp, CustomMemoryAllocatorSample.cpp, DynamicSample.cpp, and SimpleSample.cpp.

Definition at line 66 of file INetwork.hpp.

Member Typedef Documentation

◆ ConstantTensors

using ConstantTensors = std::vector<std::reference_wrapper<std::shared_ptr<ConstTensorHandle> >>

Definition at line 124 of file INetwork.hpp.

Constructor & Destructor Documentation

◆ ~IConnectableLayer()

~IConnectableLayer ( )
inlineprotected

Objects are not deletable via the handle.

Definition at line 131 of file INetwork.hpp.

131 {}

Member Function Documentation

◆ ARMNN_DEPRECATED_MSG_REMOVAL_DATE()

ARMNN_NO_DEPRECATE_WARN_BEGIN ARMNN_DEPRECATED_MSG_REMOVAL_DATE ( "Accept is deprecated. The ILayerVisitor that works in conjunction with this " "Accept function is deprecated. Use IStrategy in combination with " "ExecuteStrategy  instead,
which is an ABI/API stable version of the " "visitor pattern."  ,
"22.05"   
) const &
pure virtual

Apply a visitor to this layer.

◆ BackendSelectionHint()

virtual void BackendSelectionHint ( Optional< BackendId backend)
pure virtual

Provide a hint for the optimizer as to which backend to prefer for this layer.

Implemented in Layer.

Referenced by TEST_SUITE().

◆ ExecuteStrategy()

virtual ARMNN_NO_DEPRECATE_WARN_END void ExecuteStrategy ( IStrategy strategy) const
pure virtual

Apply a visitor to this layer.

Implemented in BindableLayer, Layer, QLstmLayer, QuantizedLstmLayer, LayerWithParameters< Parameters >, UnidirectionalSequenceLstmLayer, LayerWithParameters< FakeQuantizationDescriptor >, LayerWithParameters< SoftmaxDescriptor >, LayerWithParameters< ReduceDescriptor >, LayerWithParameters< LogSoftmaxDescriptor >, LayerWithParameters< PreCompiledDescriptor >, LayerWithParameters< LstmDescriptor >, LayerWithParameters< ChannelShuffleDescriptor >, LayerWithParameters< BatchToSpaceNdDescriptor >, LayerWithParameters< PermuteDescriptor >, LayerWithParameters< SpaceToBatchNdDescriptor >, LayerWithParameters< DepthToSpaceDescriptor >, LayerWithParameters< ReshapeDescriptor >, LayerWithParameters< ElementwiseUnaryDescriptor >, LayerWithParameters< GatherDescriptor >, LayerWithParameters< SpaceToDepthDescriptor >, LayerWithParameters< OriginsDescriptor >, LayerWithParameters< ViewsDescriptor >, LayerWithParameters< Pooling2dDescriptor >, LayerWithParameters< Convolution2dDescriptor >, LayerWithParameters< ActivationDescriptor >, LayerWithParameters< StandInDescriptor >, LayerWithParameters< TransposeDescriptor >, LayerWithParameters< StackDescriptor >, LayerWithParameters< MeanDescriptor >, LayerWithParameters< ComparisonDescriptor >, LayerWithParameters< InstanceNormalizationDescriptor >, LayerWithParameters< TransposeConvolution2dDescriptor >, LayerWithParameters< BatchNormalizationDescriptor >, LayerWithParameters< ArgMinMaxDescriptor >, LayerWithParameters< LogicalBinaryDescriptor >, LayerWithParameters< DetectionPostProcessDescriptor >, LayerWithParameters< PadDescriptor >, LayerWithParameters< Convolution3dDescriptor >, LayerWithParameters< L2NormalizationDescriptor >, LayerWithParameters< FillDescriptor >, LayerWithParameters< SliceDescriptor >, LayerWithParameters< DepthwiseConvolution2dDescriptor >, LayerWithParameters< QLstmDescriptor >, LayerWithParameters< NormalizationDescriptor >, LayerWithParameters< FullyConnectedDescriptor >, LayerWithParameters< StridedSliceDescriptor >, LayerWithParameters< ResizeDescriptor >, LayerWithParameters< Pooling3dDescriptor >, LstmLayer, FullyConnectedLayer, Convolution2dLayer, DepthwiseConvolution2dLayer, TransposeConvolution2dLayer, BatchNormalizationLayer, ConstantLayer, Convolution3dLayer, ShapeLayer, DetectionPostProcessLayer, PreCompiledLayer, FakeQuantizationLayer, MemCopyLayer, MemImportLayer, ElementwiseBaseLayer, and RankLayer.

Referenced by armnn::TEST_SUITE().

◆ GetConstantTensorsByRef()

◆ GetGuid()

virtual LayerGuid GetGuid ( ) const
pure virtual

◆ GetInputSlot() [1/2]

◆ GetInputSlot() [2/2]

virtual IInputSlot& GetInputSlot ( unsigned int  index)
pure virtual

Get the input slot handle by slot index.

Implemented in Layer.

◆ GetName()

virtual const char* GetName ( ) const
pure virtual

◆ GetNumInputSlots()

◆ GetNumOutputSlots()

◆ GetOutputSlot() [1/2]

◆ GetOutputSlot() [2/2]

virtual IOutputSlot& GetOutputSlot ( unsigned int  index)
pure virtual

Get the output slot handle by slot index.

Implemented in Layer.

◆ GetParameters()

virtual const BaseDescriptor& GetParameters ( ) const
pure virtual

If the layer has a descriptor return it.

The base descriptor can then be cast to the correct descriptor class. If the layer has no associated descriptor a struct of type NullDescriptor will be returned. Note: NullDescriptors can be detected because they return true when the BaseDescriptor IsNull function is invoked.

Implemented in Layer, LayerWithParameters< Parameters >, LayerWithParameters< FakeQuantizationDescriptor >, LayerWithParameters< SoftmaxDescriptor >, LayerWithParameters< ReduceDescriptor >, LayerWithParameters< LogSoftmaxDescriptor >, LayerWithParameters< PreCompiledDescriptor >, LayerWithParameters< LstmDescriptor >, LayerWithParameters< ChannelShuffleDescriptor >, LayerWithParameters< BatchToSpaceNdDescriptor >, LayerWithParameters< PermuteDescriptor >, LayerWithParameters< SpaceToBatchNdDescriptor >, LayerWithParameters< DepthToSpaceDescriptor >, LayerWithParameters< ReshapeDescriptor >, LayerWithParameters< ElementwiseUnaryDescriptor >, LayerWithParameters< GatherDescriptor >, LayerWithParameters< SpaceToDepthDescriptor >, LayerWithParameters< OriginsDescriptor >, LayerWithParameters< ViewsDescriptor >, LayerWithParameters< Pooling2dDescriptor >, LayerWithParameters< Convolution2dDescriptor >, LayerWithParameters< ActivationDescriptor >, LayerWithParameters< StandInDescriptor >, LayerWithParameters< TransposeDescriptor >, LayerWithParameters< StackDescriptor >, LayerWithParameters< MeanDescriptor >, LayerWithParameters< ComparisonDescriptor >, LayerWithParameters< InstanceNormalizationDescriptor >, LayerWithParameters< TransposeConvolution2dDescriptor >, LayerWithParameters< BatchNormalizationDescriptor >, LayerWithParameters< ArgMinMaxDescriptor >, LayerWithParameters< LogicalBinaryDescriptor >, LayerWithParameters< DetectionPostProcessDescriptor >, LayerWithParameters< PadDescriptor >, LayerWithParameters< Convolution3dDescriptor >, LayerWithParameters< L2NormalizationDescriptor >, LayerWithParameters< FillDescriptor >, LayerWithParameters< SliceDescriptor >, LayerWithParameters< DepthwiseConvolution2dDescriptor >, LayerWithParameters< QLstmDescriptor >, LayerWithParameters< NormalizationDescriptor >, LayerWithParameters< FullyConnectedDescriptor >, LayerWithParameters< StridedSliceDescriptor >, LayerWithParameters< ResizeDescriptor >, and LayerWithParameters< Pooling3dDescriptor >.

Referenced by TEST_SUITE().

◆ GetType()

◆ InferOutputShapes()


The documentation for this class was generated from the following file: