ArmNN  NotReleased
PreCompiledLayer Class Reference

#include <PreCompiledLayer.hpp>

Inheritance diagram for PreCompiledLayer:
LayerWithParameters< PreCompiledDescriptor > Layer IConnectableLayer

Public Member Functions

 PreCompiledLayer (const PreCompiledDescriptor &param, const char *name)
 
 ~PreCompiledLayer ()
 
virtual std::unique_ptr< IWorkloadCreateWorkload (const IWorkloadFactory &factory) const override
 
PreCompiledLayerClone (Graph &graph) const override
 
void ValidateTensorShapesFromInputs () override
 
void SetPreCompiledObject (PreCompiledObjectPtr preCompiledObject)
 
void Accept (ILayerVisitor &visitor) const override
 
- Public Member Functions inherited from LayerWithParameters< PreCompiledDescriptor >
const PreCompiledDescriptorGetParameters () const
 
void SerializeLayerParameters (ParameterStringifyFunction &fn) const override
 
- Public Member Functions inherited from Layer
 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 OutputHandlerGetOutputHandler (unsigned int i=0) const
 
OutputHandlerGetOutputHandler (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 BackendIdGetBackendId () const
 
void SetBackendId (const BackendId &id)
 
virtual void CreateTensorHandles (const TensorHandleFactoryRegistry &registry, const IWorkloadFactory &factory, const bool IsMemoryManaged=true)
 
void VerifyLayerConnections (unsigned int expectedConnections, const CheckLocation &location) const
 
std::vector< TensorShapeInferOutputShapes (const std::vector< TensorShape > &inputShapes) const override
 
virtual void ReleaseConstantData ()
 
template<typename Op >
void OperateOnConstantTensors (Op op)
 
const char * GetName () const override
 
unsigned int GetNumInputSlots () const override
 
unsigned int GetNumOutputSlots () const override
 
const InputSlotGetInputSlot (unsigned int index) const override
 
InputSlotGetInputSlot (unsigned int index) override
 
const OutputSlotGetOutputSlot (unsigned int index=0) const override
 
OutputSlotGetOutputSlot (unsigned int index=0) override
 
void SetGuid (LayerGuid guid)
 
LayerGuid GetGuid () const final
 
void AddRelatedLayerName (const std::string layerName)
 
const std::list< std::string > & GetRelatedLayerNames ()
 
virtual void Reparent (Graph &dest, std::list< Layer *>::const_iterator iterator)=0
 

Additional Inherited Members

- Public Types inherited from LayerWithParameters< PreCompiledDescriptor >
using DescriptorType = PreCompiledDescriptor
 
- Protected Types inherited from Layer
using ConstantTensors = std::vector< std::reference_wrapper< std::unique_ptr< ScopedCpuTensorHandle > >>
 
- Protected Member Functions inherited from LayerWithParameters< PreCompiledDescriptor >
 LayerWithParameters (unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const PreCompiledDescriptor &param, const char *name)
 
 ~LayerWithParameters ()=default
 
WorkloadInfo PrepInfoAndDesc (QueueDescriptor &descriptor) const
 Helper function to reduce duplication in *LayerCreateWorkload. More...
 
- Protected Member Functions inherited from Layer
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>
LayerTypeCloneBase (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 inherited from LayerWithParameters< PreCompiledDescriptor >
PreCompiledDescriptor m_Param
 The parameters for the layer (not including tensor-valued weights etc.). More...
 
- Protected Attributes inherited from Layer
std::vector< OutputHandlerm_OutputHandlers
 

Detailed Description

Definition at line 22 of file PreCompiledLayer.hpp.

Constructor & Destructor Documentation

◆ PreCompiledLayer()

PreCompiledLayer ( const PreCompiledDescriptor param,
const char *  name 
)

Definition at line 17 of file PreCompiledLayer.cpp.

References armnn::PreCompiled.

18  : LayerWithParameters(param.m_NumInputSlots, param.m_NumOutputSlots, LayerType::PreCompiled, param, name)
19 {}
LayerWithParameters(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const PreCompiledDescriptor &param, const char *name)

◆ ~PreCompiledLayer()

Definition at line 21 of file PreCompiledLayer.cpp.

22 {}

Member Function Documentation

◆ Accept()

void Accept ( ILayerVisitor visitor) const
overridevirtual

Implements IConnectableLayer.

Definition at line 49 of file PreCompiledLayer.cpp.

50 {
51  boost::ignore_unused(visitor);
52  throw armnn::Exception("PreCompiledLayer should not appear in an input graph");
53 }
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46

◆ Clone()

PreCompiledLayer * Clone ( Graph graph) const
overridevirtual

Creates a dynamically-allocated copy of this layer.

Parameters
graph- The Graph into which this Layer is being cloned.

Implements Layer.

Definition at line 24 of file PreCompiledLayer.cpp.

References Layer::GetName(), and LayerWithParameters< PreCompiledDescriptor >::m_Param.

25 {
26  PreCompiledLayer* clone = CloneBase<PreCompiledLayer>(graph, m_Param, GetName());
27  clone->m_PreCompiledObject.reset(const_cast<PreCompiledLayer*>(this)->m_PreCompiledObject.release());
28  return clone;
29 }
const char * GetName() const override
Definition: Layer.hpp:305
PreCompiledDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
PreCompiledLayer(const PreCompiledDescriptor &param, const char *name)

◆ CreateWorkload()

std::unique_ptr< IWorkload > CreateWorkload ( const IWorkloadFactory factory) const
overridevirtual

Implements Layer.

Definition at line 31 of file PreCompiledLayer.cpp.

References IWorkloadFactory::CreatePreCompiled(), PreCompiledQueueDescriptor::m_PreCompiledObject, and LayerWithParameters< PreCompiledDescriptor >::PrepInfoAndDesc().

32 {
33  PreCompiledQueueDescriptor descriptor;
34  descriptor.m_PreCompiledObject = m_PreCompiledObject.get();
35  return factory.CreatePreCompiled(descriptor, PrepInfoAndDesc(descriptor));
36 }
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.

◆ SetPreCompiledObject()

void SetPreCompiledObject ( PreCompiledObjectPtr  preCompiledObject)

Definition at line 44 of file PreCompiledLayer.cpp.

45 {
46  m_PreCompiledObject = std::move(preCompiledObject);
47 }

◆ ValidateTensorShapesFromInputs()

void ValidateTensorShapesFromInputs ( )
overridevirtual

Implements Layer.

Definition at line 38 of file PreCompiledLayer.cpp.

39 {
40  // NOTE: since the PreCompiledLayer is an internal layer created from a valid SubgraphView,
41  // we do not need to validate its input shapes
42 }

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