13template <
typename Parameters>
31 unsigned int numOutputSlots,
33 const Parameters& param,
35 :
Layer(numInputSlots, numOutputSlots, type, name)
43 template <
typename QueueDescriptor>
46 descriptor.m_Parameters =
m_Param;
69 auto &constantLayer =
static_cast<ConstantLayer&
>(inputLayer);
71 tensors.push_back(constantLayer.m_LayerOutput);
A layer that the constant data can be bound to.
std::vector< std::reference_wrapper< const std::shared_ptr< ConstTensorHandle > > > ImmutableConstantTensors
virtual void ExecuteStrategy(const IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
Layer(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const char *name)
unsigned int GetNumInputSlots() const override
Returns the number of connectable input slots.
virtual void SerializeLayerParameters(ParameterStringifyFunction &fn) const
Helper to serialize the layer parameters to string.
const char * GetName() const override
Returns the name of the layer.
bool GetAllowExpandedDims() const
LayerWithParameters(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const Parameters ¶m, const char *name)
void SerializeLayerParameters(ParameterStringifyFunction &fn) const override
Helper to serialize the layer parameters to string (currently used in DotSerializer and company).
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
const Parameters & GetParameters() const override
If the layer has a descriptor return it.
Parameters DescriptorType
Parameters m_Param
The parameters for the layer (not including tensor-valued weights etc.).
Layer::ImmutableConstantTensors GetConnectedConstantAsInputTensors() const
~LayerWithParameters()=default
Layer & GetOwningLayer() const
Copyright (c) 2021 ARM Limited and Contributors.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout, const armnn::DataType dataType)
static void Serialize(ParameterStringifyFunction &, const LayerParameter &)
Contains information about TensorInfos of a layer.