20.02
|
#include <Layer.hpp>
Public Member Functions | |
Layer (unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const char *name) | |
Layer (unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, DataLayout layout, const char *name) | |
const std::string & | GetNameStr () const |
const OutputHandler & | GetOutputHandler (unsigned int i=0) const |
OutputHandler & | GetOutputHandler (unsigned int i=0) |
const std::vector< InputSlot > & | GetInputSlots () const |
const std::vector< OutputSlot > & | GetOutputSlots () const |
std::vector< InputSlot >::iterator | BeginInputSlots () |
std::vector< InputSlot >::iterator | EndInputSlots () |
std::vector< OutputSlot >::iterator | BeginOutputSlots () |
std::vector< OutputSlot >::iterator | EndOutputSlots () |
bool | IsOutputUnconnected () |
void | ResetPriority () const |
LayerPriority | GetPriority () const |
LayerType | GetType () const |
DataType | GetDataType () const |
const BackendId & | GetBackendId () const |
void | SetBackendId (const BackendId &id) |
virtual std::unique_ptr< IWorkload > | CreateWorkload (const IWorkloadFactory &factory) const =0 |
virtual void | CreateTensorHandles (const TensorHandleFactoryRegistry ®istry, const IWorkloadFactory &factory, const bool IsMemoryManaged=true) |
virtual Layer * | Clone (Graph &graph) const =0 |
Creates a dynamically-allocated copy of this layer. More... | |
void | VerifyLayerConnections (unsigned int expectedConnections, const CheckLocation &location) const |
virtual void | ValidateTensorShapesFromInputs ()=0 |
std::vector< TensorShape > | InferOutputShapes (const std::vector< TensorShape > &inputShapes) const override |
Infer the shape of the output(s) based on the provided input shape(s) More... | |
virtual void | SerializeLayerParameters (ParameterStringifyFunction &fn) const |
Helper to serialize the layer parameters to string. More... | |
virtual void | ReleaseConstantData () |
template<typename Op > | |
void | OperateOnConstantTensors (Op op) |
const char * | GetName () const override |
Returns the name of the layer. More... | |
unsigned int | GetNumInputSlots () const override |
Returns the number of connectable input slots. More... | |
unsigned int | GetNumOutputSlots () const override |
Returns the number of connectable output slots. More... | |
const InputSlot & | GetInputSlot (unsigned int index) const override |
Get a const input slot handle by slot index. More... | |
InputSlot & | GetInputSlot (unsigned int index) override |
Get the input slot handle by slot index. More... | |
const OutputSlot & | GetOutputSlot (unsigned int index=0) const override |
Get the const output slot handle by slot index. More... | |
OutputSlot & | GetOutputSlot (unsigned int index=0) override |
Get the output slot handle by slot index. More... | |
void | SetGuid (LayerGuid guid) |
LayerGuid | GetGuid () const final |
Returns the unique id of the layer. More... | |
void | AddRelatedLayerName (const std::string layerName) |
const std::list< std::string > & | GetRelatedLayerNames () |
virtual void | Reparent (Graph &dest, std::list< Layer *>::const_iterator iterator)=0 |
void | BackendSelectionHint (Optional< BackendId > backend) final |
Provide a hint for the optimizer as to which backend to prefer for this layer. More... | |
Optional< BackendId > | GetBackendHint () const |
Public Member Functions inherited from IConnectableLayer | |
virtual void | Accept (ILayerVisitor &visitor) const =0 |
Apply a visitor to this layer. More... | |
Protected Types | |
using | ConstantTensors = std::vector< std::reference_wrapper< std::unique_ptr< ScopedCpuTensorHandle > >> |
Protected Member Functions | |
virtual | ~Layer ()=default |
template<typename QueueDescriptor > | |
void | CollectQueueDescriptorInputs (QueueDescriptor &descriptor, WorkloadInfo &info) const |
template<typename QueueDescriptor > | |
void | CollectQueueDescriptorOutputs (QueueDescriptor &descriptor, WorkloadInfo &info) const |
template<typename QueueDescriptor > | |
WorkloadInfo | PrepInfoAndDesc (QueueDescriptor &descriptor) const |
Helper function to reduce duplication in *LayerCreateWorkload. More... | |
template<typename LayerType , typename ... Params> | |
LayerType * | CloneBase (Graph &graph, Params &&... params) const |
virtual ConstantTensors | GetConstantTensorsByRef () |
Protected Member Functions inherited from IConnectableLayer | |
~IConnectableLayer () | |
Objects are not deletable via the handle. More... | |
Protected Attributes | |
std::vector< OutputHandler > | m_OutputHandlers |
Friends | |
class | Graph |
|
protected |
Layer | ( | unsigned int | numInputSlots, |
unsigned int | numOutputSlots, | ||
LayerType | type, | ||
const char * | name | ||
) |
name | - Optional name for the layer (may be nullptr). |
Definition at line 213 of file Layer.cpp.
References Layer::GetInputSlots(), Layer::m_OutputHandlers, and WorkloadDataCollector::Push().
Layer | ( | unsigned int | numInputSlots, |
unsigned int | numOutputSlots, | ||
LayerType | type, | ||
DataLayout | layout, | ||
const char * | name | ||
) |
Definition at line 187 of file Layer.cpp.
References armnn::IgnoreUnused(), and Layer::m_OutputHandlers.
|
protectedvirtualdefault |
|
inline |
Provide a hint for the optimizer as to which backend to prefer for this layer.
Implements IConnectableLayer.
Definition at line 324 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 235 of file Layer.hpp.
Referenced by armnn::InsertConvertFp16ToFp32LayersBefore(), ConvertFp32NetworkToFp16Impl::Run(), MovePermuteUpImpl::Run(), and MoveTransposeUpImpl::Run().
|
inline |
Definition at line 239 of file Layer.hpp.
Referenced by Graph::Graph(), armnn::InsertDebugLayerAfter(), ConvertFp32NetworkToFp16Impl::Run(), and SquashEqualSiblingsImpl< Comparable >::Run().
Creates a dynamically-allocated copy of this layer.
Implemented in LstmLayer, QuantizedLstmLayer, OutputLayer, BatchNormalizationLayer, SplitterLayer, ConcatLayer, Convolution2dLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, TransposeConvolution2dLayer, DetectionPostProcessLayer, PreCompiledLayer, ConstantLayer, ArgMinMaxLayer, ComparisonLayer, ConvertFp16ToFp32Layer, DepthToSpaceLayer, DivisionLayer, ElementwiseUnaryLayer, GatherLayer, LogSoftmaxLayer, MaximumLayer, MeanLayer, MinimumLayer, MultiplicationLayer, PadLayer, PreluLayer, SpaceToBatchNdLayer, SpaceToDepthLayer, StandInLayer, SubtractionLayer, AbsLayer, AdditionLayer, BatchToSpaceNdLayer, ConvertFp32ToFp16Layer, DebugLayer, DequantizeLayer, FakeQuantizationLayer, FloorLayer, InputLayer, InstanceNormalizationLayer, L2NormalizationLayer, MemCopyLayer, MemImportLayer, MergeLayer, NormalizationLayer, PermuteLayer, Pooling2dLayer, ReshapeLayer, ResizeLayer, RsqrtLayer, SliceLayer, SoftmaxLayer, StackLayer, StridedSliceLayer, SwitchLayer, ActivationLayer, TransposeLayer, and QuantizeLayer.
Referenced by Graph::Graph().
Definition at line 14 of file LayerCloneBase.hpp.
References Graph::AddLayer(), Layer::GetBackendId(), and Layer::GetGuid().
|
inlineprotected |
Definition at line 336 of file Layer.hpp.
References QueueDescriptor::m_Inputs, and WorkloadInfo::m_InputTensorInfos.
|
inlineprotected |
Definition at line 343 of file Layer.hpp.
References QueueDescriptor::m_Outputs, and WorkloadInfo::m_OutputTensorInfos.
|
virtual |
Reimplemented in SplitterLayer, ConcatLayer, and OutputLayer.
Definition at line 240 of file Layer.cpp.
References OutputHandler::CreateTensorHandles(), TensorHandleFactoryRegistry::GetFactory(), Layer::GetNumOutputSlots(), Layer::GetOutputHandler(), Layer::GetOutputSlot(), OutputSlot::GetTensorHandleFactoryId(), and ITensorHandleFactory::LegacyFactoryId.
|
pure virtual |
Implemented in LstmLayer, QuantizedLstmLayer, BatchNormalizationLayer, Convolution2dLayer, PreCompiledLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, TransposeConvolution2dLayer, DetectionPostProcessLayer, ConstantLayer, ArgMinMaxLayer, ComparisonLayer, ConvertFp16ToFp32Layer, DepthToSpaceLayer, DivisionLayer, ElementwiseUnaryLayer, GatherLayer, LogSoftmaxLayer, MaximumLayer, MeanLayer, MinimumLayer, MultiplicationLayer, PadLayer, PreluLayer, SpaceToBatchNdLayer, SpaceToDepthLayer, StandInLayer, SubtractionLayer, AbsLayer, AdditionLayer, BatchToSpaceNdLayer, ConcatLayer, ConvertFp32ToFp16Layer, DebugLayer, DequantizeLayer, FakeQuantizationLayer, FloorLayer, InputLayer, InstanceNormalizationLayer, L2NormalizationLayer, MemCopyLayer, MemImportLayer, MergeLayer, NormalizationLayer, OutputLayer, PermuteLayer, Pooling2dLayer, QuantizeLayer, ReshapeLayer, ResizeLayer, RsqrtLayer, SliceLayer, SoftmaxLayer, SplitterLayer, StackLayer, StridedSliceLayer, SwitchLayer, ActivationLayer, and TransposeLayer.
|
inline |
Definition at line 236 of file Layer.hpp.
Referenced by armnn::InsertConvertFp16ToFp32LayersBefore(), ConvertFp32NetworkToFp16Impl::Run(), MovePermuteUpImpl::Run(), and MoveTransposeUpImpl::Run().
|
inline |
Definition at line 240 of file Layer.hpp.
Referenced by armnn::InsertDebugLayerAfter(), and ConvertFp32NetworkToFp16Impl::Run().
|
inline |
Definition at line 263 of file Layer.hpp.
Referenced by Graph::AddCompatibilityLayers(), armnn::ApplyBackendOptimizations(), armnn::AttemptBackendAssignment(), BOOST_AUTO_TEST_CASE(), armnn::CalculateEdgeStrategy(), armnn::CalculateSlotOption(), armnn::CalculateSlotOptionForInput(), Layer::CloneBase(), LoadedNetwork::GetOutputTensorInfo(), and armnn::SelectTensorHandleStrategy().
|
inlineprotectedvirtual |
Reimplemented in LstmLayer, QuantizedLstmLayer, Convolution2dLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, TransposeConvolution2dLayer, BatchNormalizationLayer, ConstantLayer, and DetectionPostProcessLayer.
Definition at line 364 of file Layer.hpp.
DataType GetDataType | ( | ) | const |
Definition at line 273 of file Layer.cpp.
References InputSlot::GetConnection(), TensorInfo::GetDataType(), Layer::GetInputSlot(), Layer::GetNumInputSlots(), Layer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), and OutputSlot::GetTensorInfo().
Referenced by BOOST_AUTO_TEST_CASE(), ConvertFp32NetworkToFp16Impl::Run(), IsFloat32Layer::Test(), and IsFloat16Layer::Test().
|
inlinefinalvirtual |
Returns the unique id of the layer.
Implements IConnectableLayer.
Definition at line 316 of file Layer.hpp.
Referenced by Layer::CloneBase(), DebugLayer::CreateWorkload(), OutputSlot::GetOwningLayerGuid(), QuantizerVisitor::QuantizerVisitor(), and Graph::SerializeToDot().
|
inlineoverridevirtual |
Get a const input slot handle by slot index.
Implements IConnectableLayer.
Definition at line 310 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CreateConvolution2dGraph(), CreateDepthwiseConvolution2dGraph(), CreateGatherGraph(), CreatePooling2dGraph(), CreateResizeBilinearGraph(), ConcatLayer::CreateWorkload(), DebugLayer::CreateWorkload(), Layer::GetDataType(), Graph::Graph(), InputSlot::Insert(), armnn::InsertConvertFp16ToFp32LayersBefore(), armnn::InsertConvertFp32ToFp16LayersAfter(), armnn::InsertDebugLayerAfter(), IWorkloadFactory::IsLayerSupported(), PermuteAsReshapeImpl::Run(), TransposeAsReshapeImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), OptimizeInverseConversionsImpl::Run(), OptimizeInversePermutesImpl< PermuteType >::Run(), MovePermuteUpImpl::Run(), MoveTransposeUpImpl::Run(), DepthwiseConvolution2dLayer::SerializeLayerParameters(), Convolution2dLayer::SerializeLayerParameters(), ElementwiseBaseLayer::ValidateTensorShapesFromInputs(), QuantizeLayer::ValidateTensorShapesFromInputs(), ActivationLayer::ValidateTensorShapesFromInputs(), TransposeLayer::ValidateTensorShapesFromInputs(), SoftmaxLayer::ValidateTensorShapesFromInputs(), L2NormalizationLayer::ValidateTensorShapesFromInputs(), BatchToSpaceNdLayer::ValidateTensorShapesFromInputs(), MemCopyLayer::ValidateTensorShapesFromInputs(), MemImportLayer::ValidateTensorShapesFromInputs(), NormalizationLayer::ValidateTensorShapesFromInputs(), DebugLayer::ValidateTensorShapesFromInputs(), MergeLayer::ValidateTensorShapesFromInputs(), PermuteLayer::ValidateTensorShapesFromInputs(), Pooling2dLayer::ValidateTensorShapesFromInputs(), DequantizeLayer::ValidateTensorShapesFromInputs(), ResizeLayer::ValidateTensorShapesFromInputs(), AbsLayer::ValidateTensorShapesFromInputs(), RsqrtLayer::ValidateTensorShapesFromInputs(), SliceLayer::ValidateTensorShapesFromInputs(), FakeQuantizationLayer::ValidateTensorShapesFromInputs(), StackLayer::ValidateTensorShapesFromInputs(), SwitchLayer::ValidateTensorShapesFromInputs(), FloorLayer::ValidateTensorShapesFromInputs(), InstanceNormalizationLayer::ValidateTensorShapesFromInputs(), ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs(), GatherLayer::ValidateTensorShapesFromInputs(), LogSoftmaxLayer::ValidateTensorShapesFromInputs(), MeanLayer::ValidateTensorShapesFromInputs(), ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs(), ElementwiseUnaryLayer::ValidateTensorShapesFromInputs(), StridedSliceLayer::ValidateTensorShapesFromInputs(), ArgMinMaxLayer::ValidateTensorShapesFromInputs(), PreluLayer::ValidateTensorShapesFromInputs(), SpaceToDepthLayer::ValidateTensorShapesFromInputs(), TransposeConvolution2dLayer::ValidateTensorShapesFromInputs(), DepthToSpaceLayer::ValidateTensorShapesFromInputs(), DepthwiseConvolution2dLayer::ValidateTensorShapesFromInputs(), ComparisonLayer::ValidateTensorShapesFromInputs(), FullyConnectedLayer::ValidateTensorShapesFromInputs(), SpaceToBatchNdLayer::ValidateTensorShapesFromInputs(), Convolution2dLayer::ValidateTensorShapesFromInputs(), ConcatLayer::ValidateTensorShapesFromInputs(), BatchNormalizationLayer::ValidateTensorShapesFromInputs(), OutputLayer::ValidateTensorShapesFromInputs(), QuantizedLstmLayer::ValidateTensorShapesFromInputs(), LstmLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyLayerConnections().
|
inlineoverridevirtual |
Get the input slot handle by slot index.
Implements IConnectableLayer.
|
inline |
Definition at line 231 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), SplitterLayer::CreateWorkload(), LoadedNetwork::EnqueueWorkload(), armnn::ForEachLayerInput(), Layer::GetPriority(), IWorkloadFactory::IsLayerSupported(), and Layer::Layer().
|
inlineoverridevirtual |
Returns the name of the layer.
Implements IConnectableLayer.
Definition at line 305 of file Layer.hpp.
Referenced by AdditionLayer::Accept(), QuantizeLayer::Accept(), MultiplicationLayer::Accept(), DivisionLayer::Accept(), MaximumLayer::Accept(), SubtractionLayer::Accept(), MinimumLayer::Accept(), ActivationLayer::Accept(), AbsLayer::Accept(), NormalizationLayer::Accept(), FloorLayer::Accept(), InputLayer::Accept(), InstanceNormalizationLayer::Accept(), RsqrtLayer::Accept(), SoftmaxLayer::Accept(), L2NormalizationLayer::Accept(), SwitchLayer::Accept(), DequantizeLayer::Accept(), PadLayer::Accept(), GatherLayer::Accept(), LogSoftmaxLayer::Accept(), MeanLayer::Accept(), MergeLayer::Accept(), ArgMinMaxLayer::Accept(), DetectionPostProcessLayer::Accept(), Pooling2dLayer::Accept(), ElementwiseUnaryLayer::Accept(), ResizeLayer::Accept(), SliceLayer::Accept(), BatchToSpaceNdLayer::Accept(), StackLayer::Accept(), StridedSliceLayer::Accept(), PreluLayer::Accept(), SpaceToBatchNdLayer::Accept(), SpaceToDepthLayer::Accept(), DepthToSpaceLayer::Accept(), ComparisonLayer::Accept(), StandInLayer::Accept(), ConstantLayer::Accept(), BatchNormalizationLayer::Accept(), OutputLayer::Accept(), TransposeConvolution2dLayer::Accept(), FullyConnectedLayer::Accept(), DepthwiseConvolution2dLayer::Accept(), Convolution2dLayer::Accept(), ConcatLayer::Accept(), ReshapeLayer::Accept(), SplitterLayer::Accept(), TransposeLayer::Accept(), PermuteLayer::Accept(), QuantizedLstmLayer::Accept(), LstmLayer::Accept(), Graph::AddCompatibilityLayers(), BOOST_AUTO_TEST_CASE(), armnnTfParser::CalcPadding(), QuantizeLayer::Clone(), TransposeLayer::Clone(), ActivationLayer::Clone(), NormalizationLayer::Clone(), PermuteLayer::Clone(), Pooling2dLayer::Clone(), FakeQuantizationLayer::Clone(), StackLayer::Clone(), FloorLayer::Clone(), MemImportLayer::Clone(), AbsLayer::Clone(), ConvertFp32ToFp16Layer::Clone(), ReshapeLayer::Clone(), ResizeLayer::Clone(), SoftmaxLayer::Clone(), MergeLayer::Clone(), L2NormalizationLayer::Clone(), SliceLayer::Clone(), InputLayer::Clone(), InstanceNormalizationLayer::Clone(), BatchToSpaceNdLayer::Clone(), DebugLayer::Clone(), StridedSliceLayer::Clone(), RsqrtLayer::Clone(), AdditionLayer::Clone(), SwitchLayer::Clone(), DequantizeLayer::Clone(), MemCopyLayer::Clone(), ConvertFp16ToFp32Layer::Clone(), StandInLayer::Clone(), PreluLayer::Clone(), MultiplicationLayer::Clone(), GatherLayer::Clone(), ArgMinMaxLayer::Clone(), PadLayer::Clone(), SpaceToDepthLayer::Clone(), DivisionLayer::Clone(), MinimumLayer::Clone(), ElementwiseUnaryLayer::Clone(), SpaceToBatchNdLayer::Clone(), SubtractionLayer::Clone(), MaximumLayer::Clone(), LogSoftmaxLayer::Clone(), MeanLayer::Clone(), ComparisonLayer::Clone(), DepthToSpaceLayer::Clone(), ConstantLayer::Clone(), PreCompiledLayer::Clone(), DetectionPostProcessLayer::Clone(), TransposeConvolution2dLayer::Clone(), FullyConnectedLayer::Clone(), DepthwiseConvolution2dLayer::Clone(), Convolution2dLayer::Clone(), ConcatLayer::Clone(), SplitterLayer::Clone(), BatchNormalizationLayer::Clone(), OutputLayer::Clone(), QuantizedLstmLayer::Clone(), LstmLayer::Clone(), armnn::InsertConvertFp16ToFp32LayersBefore(), armnn::InsertConvertFp32ToFp16LayersAfter(), TransposeAsReshapeImpl::Run(), PermuteAsReshapeImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), and ErasedLayerNamesObservable::Update().
|
inline |
Definition at line 216 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), armnn::CheckScaleSetOnQuantizedType(), DebugLayer::CreateWorkload(), LoadedNetwork::GetOutputTensorInfo(), Layer::InferOutputShapes(), armnn::InsertDebugLayerAfter(), IsConnected(), and Layer::VerifyLayerConnections().
|
inlineoverridevirtual |
Returns the number of connectable input slots.
Implements IConnectableLayer.
Definition at line 307 of file Layer.hpp.
Referenced by CheckNumberOfInputSlot(), ConcatLayer::CreateWorkload(), LoadedNetwork::EnqueueWorkload(), Layer::GetDataType(), Layer::InferOutputShapes(), InputSlot::Insert(), armnn::InsertConvertFp16ToFp32LayersBefore(), StackLayer::ValidateTensorShapesFromInputs(), ConcatLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyLayerConnections().
|
inlineoverridevirtual |
Returns the number of connectable output slots.
Implements IConnectableLayer.
Definition at line 308 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), armnnTfParser::CalcPadding(), OutputSlot::CalculateIndexOnOwner(), CheckNumberOfOutputSlot(), armnn::CheckScaleSetOnQuantizedType(), Layer::CreateTensorHandles(), LoadedNetwork::EnqueueWorkload(), Layer::InferOutputShapes(), InputSlot::Insert(), armnn::InsertConvertFp32ToFp16LayersAfter(), armnn::InsertDebugLayerAfter(), armnn::SelectTensorHandleStrategy(), SwitchLayer::ValidateTensorShapesFromInputs(), and DetectionPostProcessLayer::ValidateTensorShapesFromInputs().
|
inline |
Definition at line 221 of file Layer.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), Layer::CreateTensorHandles(), ConcatLayer::CreateWorkload(), LoadedNetwork::EnqueueWorkload(), InputSlot::Insert(), PermuteAsReshapeImpl::Run(), TransposeAsReshapeImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), MoveTransposeUpImpl::Run(), and MovePermuteUpImpl::Run().
|
inline |
Definition at line 226 of file Layer.hpp.
|
inlineoverridevirtual |
Get the const output slot handle by slot index.
Implements IConnectableLayer.
Definition at line 312 of file Layer.hpp.
Referenced by Graph::AddCompatibilityLayers(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), armnnTfParser::CalcPadding(), OutputSlot::CalculateIndexOnOwner(), armnn::CheckScaleSetOnQuantizedType(), CreateConvolution2dGraph(), CreateDepthwiseConvolution2dGraph(), CreateGatherGraph(), CreatePooling2dGraph(), CreateResizeBilinearGraph(), ConcatLayer::CreateTensorHandles(), SplitterLayer::CreateTensorHandles(), Layer::CreateTensorHandles(), SplitterLayer::CreateWorkload(), ConcatLayer::CreateWorkload(), Layer::GetDataType(), InputSlot::Insert(), armnn::InsertConvertFp16ToFp32LayersBefore(), armnn::InsertConvertFp32ToFp16LayersAfter(), armnn::InsertDebugLayerAfter(), IsConnected(), IWorkloadFactory::IsLayerSupported(), PermuteAsReshapeImpl::Run(), TransposeAsReshapeImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), OptimizeInverseConversionsImpl::Run(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), MovePermuteUpImpl::Run(), OptimizeInversePermutesImpl< PermuteType >::Run(), MoveTransposeUpImpl::Run(), armnn::SelectTensorHandleStrategy(), ElementwiseBaseLayer::ValidateTensorShapesFromInputs(), QuantizeLayer::ValidateTensorShapesFromInputs(), ActivationLayer::ValidateTensorShapesFromInputs(), TransposeLayer::ValidateTensorShapesFromInputs(), ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs(), InputLayer::ValidateTensorShapesFromInputs(), MemImportLayer::ValidateTensorShapesFromInputs(), DebugLayer::ValidateTensorShapesFromInputs(), MergeLayer::ValidateTensorShapesFromInputs(), NormalizationLayer::ValidateTensorShapesFromInputs(), PermuteLayer::ValidateTensorShapesFromInputs(), Pooling2dLayer::ValidateTensorShapesFromInputs(), BatchToSpaceNdLayer::ValidateTensorShapesFromInputs(), DequantizeLayer::ValidateTensorShapesFromInputs(), ReshapeLayer::ValidateTensorShapesFromInputs(), ResizeLayer::ValidateTensorShapesFromInputs(), RsqrtLayer::ValidateTensorShapesFromInputs(), SliceLayer::ValidateTensorShapesFromInputs(), SoftmaxLayer::ValidateTensorShapesFromInputs(), L2NormalizationLayer::ValidateTensorShapesFromInputs(), AbsLayer::ValidateTensorShapesFromInputs(), FakeQuantizationLayer::ValidateTensorShapesFromInputs(), MemCopyLayer::ValidateTensorShapesFromInputs(), FloorLayer::ValidateTensorShapesFromInputs(), StackLayer::ValidateTensorShapesFromInputs(), SwitchLayer::ValidateTensorShapesFromInputs(), InstanceNormalizationLayer::ValidateTensorShapesFromInputs(), GatherLayer::ValidateTensorShapesFromInputs(), LogSoftmaxLayer::ValidateTensorShapesFromInputs(), MeanLayer::ValidateTensorShapesFromInputs(), ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs(), ConstantLayer::ValidateTensorShapesFromInputs(), ArgMinMaxLayer::ValidateTensorShapesFromInputs(), DetectionPostProcessLayer::ValidateTensorShapesFromInputs(), ElementwiseUnaryLayer::ValidateTensorShapesFromInputs(), StridedSliceLayer::ValidateTensorShapesFromInputs(), TransposeConvolution2dLayer::ValidateTensorShapesFromInputs(), DepthwiseConvolution2dLayer::ValidateTensorShapesFromInputs(), SpaceToDepthLayer::ValidateTensorShapesFromInputs(), FullyConnectedLayer::ValidateTensorShapesFromInputs(), ComparisonLayer::ValidateTensorShapesFromInputs(), DepthToSpaceLayer::ValidateTensorShapesFromInputs(), SpaceToBatchNdLayer::ValidateTensorShapesFromInputs(), PreluLayer::ValidateTensorShapesFromInputs(), Convolution2dLayer::ValidateTensorShapesFromInputs(), SplitterLayer::ValidateTensorShapesFromInputs(), BatchNormalizationLayer::ValidateTensorShapesFromInputs(), QuantizedLstmLayer::ValidateTensorShapesFromInputs(), and LstmLayer::ValidateTensorShapesFromInputs().
|
inlineoverridevirtual |
Get the output slot handle by slot index.
Implements IConnectableLayer.
|
inline |
Definition at line 232 of file Layer.hpp.
Referenced by Graph::AddCompatibilityLayers(), armnn::ForEachLayerOutput(), and IWorkloadFactory::IsLayerSupported().
LayerPriority GetPriority | ( | ) | const |
Definition at line 288 of file Layer.cpp.
References Layer::GetInputSlots(), OutputSlot::GetOwningLayer(), Layer::GetPriority(), Layer::GetType(), armnn::Input, and armnn::Output.
Referenced by Layer::GetPriority(), and SquashEqualSiblingsImpl< Comparable >::Run().
|
inline |
Definition at line 320 of file Layer.hpp.
Referenced by ErasedLayerNamesObservable::Update().
|
inline |
Definition at line 259 of file Layer.hpp.
Referenced by armnn::ApplyBackendOptimizations(), armnn::AttemptBackendAssignment(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), armnn::CalculateEdgeStrategy(), armnn::CalculateSlotOption(), armnn::CalculateSlotOptionForInput(), armnn::CheckScaleSetOnQuantizedType(), ConcatLayer::CreateWorkload(), LoadedNetwork::EnqueueWorkload(), Layer::GetPriority(), Layer::InferOutputShapes(), ReshapeLayer::IsEqual(), TransposeLayer::IsEqual(), PermuteLayer::IsEqual(), TransposeLayer::IsInverse(), PermuteLayer::IsInverse(), IsLayerOfType(), IWorkloadFactory::IsLayerSupported(), MockBackend::OptimizeSubgraphView(), armnn::ReturnWithError(), ConvertFp32NetworkToFp16Impl::Run(), AddDebugImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), OptimizeInverseConversionsImpl::Run(), MoveTransposeUpImpl::Run(), MovePermuteUpImpl::Run(), OptimizeForTypeImpl< BaseType, OptimizeForConnectionImpl< BaseType, ChildType, Wrapped > >::Run(), armnn::SelectTensorHandleStrategy(), ElementwiseBaseLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyLayerConnections().
|
overridevirtual |
Infer the shape of the output(s) based on the provided input shape(s)
Implements IConnectableLayer.
Reimplemented in LstmLayer, QuantizedLstmLayer, SplitterLayer, ConcatLayer, Convolution2dLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, TransposeConvolution2dLayer, ConstantLayer, StandInLayer, BatchToSpaceNdLayer, PermuteLayer, Pooling2dLayer, ReshapeLayer, ResizeLayer, SliceLayer, StackLayer, MergeLayer, TransposeLayer, ComparisonLayer, DepthToSpaceLayer, PreluLayer, SpaceToBatchNdLayer, SpaceToDepthLayer, ArgMinMaxLayer, ElementwiseUnaryLayer, StridedSliceLayer, and ElementwiseBaseLayer.
Definition at line 371 of file Layer.cpp.
References CHECK_LOCATION, armnn::GetLayerTypeAsCString(), Layer::GetNameStr(), Layer::GetNumInputSlots(), Layer::GetNumOutputSlots(), and Layer::GetType().
Referenced by QuantizeLayer::ValidateTensorShapesFromInputs(), ActivationLayer::ValidateTensorShapesFromInputs(), SoftmaxLayer::ValidateTensorShapesFromInputs(), RsqrtLayer::ValidateTensorShapesFromInputs(), SwitchLayer::ValidateTensorShapesFromInputs(), NormalizationLayer::ValidateTensorShapesFromInputs(), MemImportLayer::ValidateTensorShapesFromInputs(), AbsLayer::ValidateTensorShapesFromInputs(), FakeQuantizationLayer::ValidateTensorShapesFromInputs(), L2NormalizationLayer::ValidateTensorShapesFromInputs(), InstanceNormalizationLayer::ValidateTensorShapesFromInputs(), FloorLayer::ValidateTensorShapesFromInputs(), ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs(), DequantizeLayer::ValidateTensorShapesFromInputs(), MemCopyLayer::ValidateTensorShapesFromInputs(), DebugLayer::ValidateTensorShapesFromInputs(), ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs(), LogSoftmaxLayer::ValidateTensorShapesFromInputs(), and BatchNormalizationLayer::ValidateTensorShapesFromInputs().
|
inline |
Definition at line 243 of file Layer.hpp.
Referenced by OptimizeForConnectionImpl< BaseType, ChildType, Wrapped >::Run().
|
inline |
Definition at line 292 of file Layer.hpp.
Referenced by Layer::ReleaseConstantData(), and ConvertConstants< Converter, Predicate >::Run().
|
inlineprotected |
Helper function to reduce duplication in *LayerCreateWorkload.
Definition at line 351 of file Layer.hpp.
References armnn::info.
Referenced by AbsLayer::CreateWorkload(), AdditionLayer::CreateWorkload(), FloorLayer::CreateWorkload(), QuantizeLayer::CreateWorkload(), ConvertFp32ToFp16Layer::CreateWorkload(), RsqrtLayer::CreateWorkload(), SwitchLayer::CreateWorkload(), DebugLayer::CreateWorkload(), MemCopyLayer::CreateWorkload(), DequantizeLayer::CreateWorkload(), MemImportLayer::CreateWorkload(), PreluLayer::CreateWorkload(), SubtractionLayer::CreateWorkload(), DivisionLayer::CreateWorkload(), ConvertFp16ToFp32Layer::CreateWorkload(), GatherLayer::CreateWorkload(), MinimumLayer::CreateWorkload(), MultiplicationLayer::CreateWorkload(), MaximumLayer::CreateWorkload(), ConstantLayer::CreateWorkload(), QuantizedLstmLayer::CreateWorkload(), and LayerWithParameters< ResizeDescriptor >::PrepInfoAndDesc().
|
virtual |
Reimplemented in ConstantLayer.
Definition at line 264 of file Layer.cpp.
References Layer::OperateOnConstantTensors().
Referenced by BOOST_AUTO_TEST_CASE().
Referenced by Graph::operator=(), and Graph::SubstituteSubgraph().
void ResetPriority | ( | ) | const |
|
virtual |
Helper to serialize the layer parameters to string.
(currently used in DotSerializer and company).
Reimplemented in Convolution2dLayer, DepthwiseConvolution2dLayer, LayerWithParameters< Parameters >, LayerWithParameters< FakeQuantizationDescriptor >, LayerWithParameters< SoftmaxDescriptor >, LayerWithParameters< LstmDescriptor >, LayerWithParameters< LogSoftmaxDescriptor >, LayerWithParameters< PreCompiledDescriptor >, LayerWithParameters< BatchToSpaceNdDescriptor >, LayerWithParameters< PermuteDescriptor >, LayerWithParameters< SpaceToBatchNdDescriptor >, LayerWithParameters< DepthToSpaceDescriptor >, LayerWithParameters< ReshapeDescriptor >, LayerWithParameters< ElementwiseUnaryDescriptor >, 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< DetectionPostProcessDescriptor >, LayerWithParameters< PadDescriptor >, LayerWithParameters< L2NormalizationDescriptor >, LayerWithParameters< SliceDescriptor >, LayerWithParameters< DepthwiseConvolution2dDescriptor >, LayerWithParameters< NormalizationDescriptor >, LayerWithParameters< FullyConnectedDescriptor >, LayerWithParameters< StridedSliceDescriptor >, and LayerWithParameters< ResizeDescriptor >.
Definition at line 398 of file Layer.cpp.
References armnn::GetLayerTypeAsCString().
Referenced by LayerWithParameters< ResizeDescriptor >::SerializeLayerParameters().
|
inline |
Definition at line 264 of file Layer.hpp.
References CreateWorkload().
Referenced by armnn::AttemptBackendAssignment(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), armnn::InsertDebugLayerAfter(), and MockBackend::OptimizeSubgraphView().
|
inline |
|
pure virtual |
Implemented in LstmLayer, QuantizedLstmLayer, OutputLayer, BatchNormalizationLayer, SplitterLayer, ConcatLayer, Convolution2dLayer, ComparisonLayer, DepthToSpaceLayer, DepthwiseConvolution2dLayer, FullyConnectedLayer, PreluLayer, SpaceToBatchNdLayer, SpaceToDepthLayer, TransposeConvolution2dLayer, ArgMinMaxLayer, DetectionPostProcessLayer, ElementwiseUnaryLayer, StridedSliceLayer, PreCompiledLayer, ConstantLayer, ConvertFp16ToFp32Layer, GatherLayer, LogSoftmaxLayer, MeanLayer, PadLayer, StandInLayer, AbsLayer, BatchToSpaceNdLayer, ConvertFp32ToFp16Layer, DebugLayer, DequantizeLayer, FakeQuantizationLayer, FloorLayer, InputLayer, InstanceNormalizationLayer, L2NormalizationLayer, MemCopyLayer, MemImportLayer, MergeLayer, NormalizationLayer, PermuteLayer, Pooling2dLayer, ReshapeLayer, ResizeLayer, RsqrtLayer, SliceLayer, SoftmaxLayer, StackLayer, SwitchLayer, TransposeLayer, ActivationLayer, QuantizeLayer, and ElementwiseBaseLayer.
void VerifyLayerConnections | ( | unsigned int | expectedConnections, |
const CheckLocation & | location | ||
) | const |
Definition at line 338 of file Layer.cpp.
References CheckLocation::AsString(), Layer::GetInputSlot(), armnn::GetLayerTypeAsCString(), Layer::GetNameStr(), Layer::GetNumInputSlots(), and Layer::GetType().
Referenced by ElementwiseBaseLayer::ValidateTensorShapesFromInputs(), QuantizeLayer::ValidateTensorShapesFromInputs(), ActivationLayer::ValidateTensorShapesFromInputs(), TransposeLayer::ValidateTensorShapesFromInputs(), SwitchLayer::ValidateTensorShapesFromInputs(), L2NormalizationLayer::ValidateTensorShapesFromInputs(), AbsLayer::ValidateTensorShapesFromInputs(), Pooling2dLayer::ValidateTensorShapesFromInputs(), ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs(), SliceLayer::ValidateTensorShapesFromInputs(), RsqrtLayer::ValidateTensorShapesFromInputs(), FakeQuantizationLayer::ValidateTensorShapesFromInputs(), ReshapeLayer::ValidateTensorShapesFromInputs(), ResizeLayer::ValidateTensorShapesFromInputs(), FloorLayer::ValidateTensorShapesFromInputs(), SoftmaxLayer::ValidateTensorShapesFromInputs(), StackLayer::ValidateTensorShapesFromInputs(), PermuteLayer::ValidateTensorShapesFromInputs(), BatchToSpaceNdLayer::ValidateTensorShapesFromInputs(), InstanceNormalizationLayer::ValidateTensorShapesFromInputs(), DebugLayer::ValidateTensorShapesFromInputs(), DequantizeLayer::ValidateTensorShapesFromInputs(), MemCopyLayer::ValidateTensorShapesFromInputs(), MemImportLayer::ValidateTensorShapesFromInputs(), MergeLayer::ValidateTensorShapesFromInputs(), NormalizationLayer::ValidateTensorShapesFromInputs(), ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs(), GatherLayer::ValidateTensorShapesFromInputs(), MeanLayer::ValidateTensorShapesFromInputs(), LogSoftmaxLayer::ValidateTensorShapesFromInputs(), StridedSliceLayer::ValidateTensorShapesFromInputs(), ElementwiseUnaryLayer::ValidateTensorShapesFromInputs(), ArgMinMaxLayer::ValidateTensorShapesFromInputs(), DetectionPostProcessLayer::ValidateTensorShapesFromInputs(), DepthwiseConvolution2dLayer::ValidateTensorShapesFromInputs(), TransposeConvolution2dLayer::ValidateTensorShapesFromInputs(), SpaceToDepthLayer::ValidateTensorShapesFromInputs(), FullyConnectedLayer::ValidateTensorShapesFromInputs(), PreluLayer::ValidateTensorShapesFromInputs(), SpaceToBatchNdLayer::ValidateTensorShapesFromInputs(), ComparisonLayer::ValidateTensorShapesFromInputs(), DepthToSpaceLayer::ValidateTensorShapesFromInputs(), Convolution2dLayer::ValidateTensorShapesFromInputs(), ConcatLayer::ValidateTensorShapesFromInputs(), BatchNormalizationLayer::ValidateTensorShapesFromInputs(), QuantizedLstmLayer::ValidateTensorShapesFromInputs(), and LstmLayer::ValidateTensorShapesFromInputs().
|
protected |
Definition at line 371 of file Layer.hpp.
Referenced by ConcatLayer::CreateWorkload(), SplitterLayer::CreateWorkload(), and Layer::Layer().