24.02
|
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots. More...
#include <INetwork.hpp>
Public Types | |
using | ConstantTensors = std::vector< std::reference_wrapper< std::shared_ptr< ConstTensorHandle > >> |
using | ImmutableConstantTensors = std::vector< std::reference_wrapper< const 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 IInputSlot & | GetInputSlot (unsigned int index) const =0 |
Get a const input slot handle by slot index. More... | |
virtual IInputSlot & | GetInputSlot (unsigned int index)=0 |
Get the input slot handle by slot index. More... | |
virtual const IOutputSlot & | GetOutputSlot (unsigned int index) const =0 |
Get the const output slot handle by slot index. More... | |
virtual IOutputSlot & | GetOutputSlot (unsigned int index)=0 |
Get the output slot handle by slot index. More... | |
virtual std::vector< TensorShape > | InferOutputShapes (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... | |
virtual 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 BaseDescriptor & | GetParameters () const =0 |
If the layer has a descriptor return it. More... | |
virtual void | SetBackendId (const BackendId &id)=0 |
Set the backend of the IConnectableLayer. More... | |
virtual ConstantTensors | GetConstantTensorsByRef ()=0 |
virtual ImmutableConstantTensors | GetConstantTensorsByRef () const =0 |
Protected Member Functions | |
~IConnectableLayer () | |
Objects are not deletable via the handle. More... | |
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition at line 80 of file INetwork.hpp.
using ConstantTensors = std::vector<std::reference_wrapper<std::shared_ptr<ConstTensorHandle> >> |
Definition at line 136 of file INetwork.hpp.
using ImmutableConstantTensors = std::vector<std::reference_wrapper<const std::shared_ptr<ConstTensorHandle> >> |
Definition at line 141 of file INetwork.hpp.
|
inlineprotected |
Provide a hint for the optimizer as to which backend to prefer for this layer.
By providing a BackendSelectionHint there is no guarantee the input backend supports that layer. If IsLayerSupported() returns false with the backend hint, we default to calling IsLayerSupported() on the BackendPreferences vector. Use SetBackendId() if we can guarantee a backend supports that layer (IsLayerSupported returns true for a specific backend).
Implemented in Layer.
|
pure virtual |
Apply a visitor to this layer.
Implemented in BindableLayer, Layer, QLstmLayer, QuantizedLstmLayer, PermuteLayer, TransposeLayer, LayerWithParameters< Parameters >, LayerWithParameters< SoftmaxDescriptor >, LayerWithParameters< FakeQuantizationDescriptor >, LayerWithParameters< ReduceDescriptor >, LayerWithParameters< LstmDescriptor >, LayerWithParameters< ChannelShuffleDescriptor >, LayerWithParameters< LogSoftmaxDescriptor >, LayerWithParameters< PreCompiledDescriptor >, LayerWithParameters< SpaceToBatchNdDescriptor >, LayerWithParameters< BatchToSpaceNdDescriptor >, LayerWithParameters< PermuteDescriptor >, LayerWithParameters< GatherDescriptor >, LayerWithParameters< ElementwiseUnaryDescriptor >, LayerWithParameters< DepthToSpaceDescriptor >, LayerWithParameters< OriginsDescriptor >, LayerWithParameters< SpaceToDepthDescriptor >, LayerWithParameters< ReshapeDescriptor >, LayerWithParameters< ViewsDescriptor >, LayerWithParameters< Pooling2dDescriptor >, LayerWithParameters< Convolution2dDescriptor >, LayerWithParameters< ActivationDescriptor >, LayerWithParameters< StandInDescriptor >, LayerWithParameters< MeanDescriptor >, LayerWithParameters< StackDescriptor >, LayerWithParameters< TransposeDescriptor >, LayerWithParameters< InstanceNormalizationDescriptor >, LayerWithParameters< ComparisonDescriptor >, LayerWithParameters< TransposeConvolution2dDescriptor >, LayerWithParameters< BroadcastToDescriptor >, LayerWithParameters< BatchNormalizationDescriptor >, LayerWithParameters< FusedDescriptor >, LayerWithParameters< BatchMatMulDescriptor >, LayerWithParameters< TileDescriptor >, LayerWithParameters< ArgMinMaxDescriptor >, LayerWithParameters< LogicalBinaryDescriptor >, LayerWithParameters< DetectionPostProcessDescriptor >, LayerWithParameters< PadDescriptor >, LayerWithParameters< L2NormalizationDescriptor >, LayerWithParameters< Convolution3dDescriptor >, LayerWithParameters< SliceDescriptor >, LayerWithParameters< QLstmDescriptor >, LayerWithParameters< FillDescriptor >, LayerWithParameters< DepthwiseConvolution2dDescriptor >, LayerWithParameters< NormalizationDescriptor >, LayerWithParameters< FullyConnectedDescriptor >, LayerWithParameters< ResizeDescriptor >, LayerWithParameters< Pooling3dDescriptor >, LayerWithParameters< ElementwiseBinaryDescriptor >, LayerWithParameters< StridedSliceDescriptor >, ReshapeLayer, UnidirectionalSequenceLstmLayer, ConcatLayer, LstmLayer, SplitterLayer, TransposeConvolution2dLayer, DetectionPostProcessLayer, OutputLayer, BatchNormalizationLayer, ConstantLayer, Convolution2dLayer, Convolution3dLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, ComparisonLayer, DepthToSpaceLayer, LogicalBinaryLayer, MeanLayer, PadLayer, PreluLayer, SpaceToBatchNdLayer, SpaceToDepthLayer, StandInLayer, ArgMinMaxLayer, BatchToSpaceNdLayer, ElementwiseUnaryLayer, GatherLayer, Pooling2dLayer, Pooling3dLayer, ReduceLayer, ResizeLayer, ReverseV2Layer, ShapeLayer, SliceLayer, StackLayer, StridedSliceLayer, BroadcastToLayer, ElementwiseBinaryLayer, MergeLayer, PreCompiledLayer, RankLayer, FakeQuantizationLayer, LogSoftmaxLayer, AbsLayer, ConvertFp16ToFp32Layer, DebugLayer, DequantizeLayer, FloorLayer, FusedLayer, InputLayer, InstanceNormalizationLayer, L2NormalizationLayer, MapLayer, MemCopyLayer, MemImportLayer, NormalizationLayer, RsqrtLayer, SoftmaxLayer, SwitchLayer, UnmapLayer, ConvertFp32ToFp16Layer, ElementwiseBaseLayer, FillLayer, ActivationLayer, DivisionLayer, MaximumLayer, MinimumLayer, MultiplicationLayer, SubtractionLayer, AdditionLayer, and QuantizeLayer.
|
pure virtual |
|
pure virtual |
Implemented in Layer.
|
pure virtual |
|
pure virtual |
Get a const input slot handle by slot index.
Implemented in Layer.
Referenced by Connect(), armnn_driver::ConvertPooling2d(), armnn_driver::ConvertReduce(), armnn_driver::ConvertToActivation(), armnn_driver::IsConnectedToDequantize(), armnn_driver::ProcessActivation(), and armnn_driver::SetupAndTrackLayerOutputSlot().
|
pure virtual |
Get the input slot handle by slot index.
Implemented in Layer.
|
pure virtual |
Returns the name of the layer.
Implemented in Layer.
Referenced by Connect(), and SerializerStrategy::ExecuteStrategy().
|
pure virtual |
Returns the number of connectable input slots.
Implemented in Layer.
Referenced by armnn_driver::SetupAndTrackLayerOutputSlot().
|
pure virtual |
Returns the number of connectable output slots.
Implemented in Layer.
Referenced by SubgraphView::GetWorkingCopy(), armnn_driver::ProcessActivation(), RangeTracker::SetRange(), and armnn_driver::SetupAndTrackLayerOutputSlot().
|
pure virtual |
Get the const output slot handle by slot index.
Implemented in Layer.
Referenced by Connect(), armnn_driver::ConvertToLayerInputHandle(), SubgraphView::GetWorkingCopy(), TosaRefBackend::OptimizeSubgraphView(), GpuFsaBackend::OptimizeSubgraphView(), armnn_driver::ProcessActivation(), and armnn_driver::SetupAndTrackLayerOutputSlot().
|
pure virtual |
Get the output slot handle by slot index.
Implemented in Layer.
|
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, and LayerWithParameters< Parameters >.
|
pure virtual |
Returns the armnn::LayerType of this layer.
Implemented in Layer.
Referenced by Connect(), SerializerStrategy::ExecuteStrategy(), StrategyBase< DefaultStrategy >::ExecuteStrategy(), SubgraphView::GetWorkingCopy(), and armnn_driver::IsConnectedToDequantize().
|
pure virtual |
Infer the shape of the output(s) based on the provided input shape(s)
Implemented in Layer, QLstmLayer, QuantizedLstmLayer, ConcatLayer, LstmLayer, UnidirectionalSequenceLstmLayer, SplitterLayer, DetectionPostProcessLayer, TransposeConvolution2dLayer, Convolution2dLayer, Convolution3dLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, ConstantLayer, ReshapeLayer, MeanLayer, PadLayer, StandInLayer, BatchToSpaceNdLayer, PermuteLayer, Pooling2dLayer, Pooling3dLayer, ResizeLayer, ShapeLayer, SliceLayer, StackLayer, MergeLayer, RankLayer, TransposeLayer, ComparisonLayer, DepthToSpaceLayer, LogicalBinaryLayer, PreluLayer, ReduceLayer, ReverseV2Layer, SpaceToBatchNdLayer, SpaceToDepthLayer, ArgMinMaxLayer, ElementwiseBinaryLayer, ElementwiseUnaryLayer, GatherLayer, StridedSliceLayer, BatchMatMulLayer, GatherNdLayer, TileLayer, BroadcastToLayer, and ElementwiseBaseLayer.
|
pure virtual |
Set the backend of the IConnectableLayer.
By using SetBackendId() we guarantee that the input backend supports that layer (IsLayerSupported returns true for a specific backend). If there is no guarantee the input backend supports that layer use BackendSelectionHint().
Implemented in Layer.
Referenced by armnn_driver::ConvertPooling2d(), armnn_driver::ConvertReduce(), armnn_driver::ConvertToActivation(), armnn_driver::ConvertToLayerInputHandle(), and armnn_driver::ProcessActivation().