23.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.",
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
A layer that the constant data can be bound to.
Dimensionality GetDimensionality() const
Function that returns the tensor type.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Constant type.
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,...
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
const ConstTensorHandle * m_LayerOutput
const void * Map(bool blocking=true)
RAII Managed resource Unmaps MemoryArea once out of scope.
ConstantLayer(const char *name)
Constructor to create a ConstantLayer.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
const TensorInfo & GetTensorInfo() const
Copyright (c) 2021 ARM Limited and Contributors.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
ConstantLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ConstantLayer.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
Base class for all descriptors.
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
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const
const char * GetName() const override
Returns the name of the layer.
bool AreAllDimensionsSpecified() const
Checks if there is at least one dimension not specified.