24.02
|
Go to the documentation of this file.
33 auto layer = CloneBase<ConstantLayer>(graph,
GetName());
37 return std::move(layer);
42 return std::vector<TensorShape>({ inputShapes[0] });
51 ConditionalThrow<LayerValidationException>(
53 "Constant layer m_LayerOutput output shape can not be Dimensionality::NotSpecified");
55 ConditionalThrow<LayerValidationException>(
57 "Constant layer m_LayerOutput output shape can not have an unspecified dimension");
59 ConditionalThrowIfNotEqual<LayerValidationException>(
60 "ConstantLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs,...
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ConstantLayer.
constexpr const char * GetDataTypeName(DataType dataType)
bool AreAllDimensionsSpecified() const
Checks if there is at least one dimension not specified.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
ConstantLayer(const char *name)
Constructor to create a ConstantLayer.
const char * GetName() const override
Returns the name of the layer.
virtual void SerializeLayerParameters(ParameterStringifyFunction &fn) const
Helper to serialize the layer parameters to string.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
const void * Map(bool blocking=true)
RAII Managed resource Unmaps MemoryArea once out of scope.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Base class for all descriptors.
const ConstTensorHandle * m_LayerOutput
ConstantLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Constant type.
A layer that the constant data can be bound to.
Copyright (c) 2021 ARM Limited and Contributors.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
void SerializeLayerParameters(ParameterStringifyFunction &fn) const override
Helper to serialize the layer parameters to string.
Dimensionality GetDimensionality() const
Function that returns the tensor type.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
Backends should implement their own CreateWorkload function with a switch statement.
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 TensorInfo & GetTensorInfo() const