40 auto layer = CloneBase<FullyConnectedLayer>(graph,
m_Param,
GetName());
42 if (layer->m_Param.m_BiasEnabled)
46 return std::move(layer);
56 unsigned int batches = inputShape[0];
59 return std::vector<TensorShape>({
TensorShape({batches, weightShape[dimIdx]})});
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the FullyConnected 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, otherwise infers the output shapes from given input shapes and layer properties.
FullyConnectedDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
const TensorShape & GetShape() const
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
ConstantTensors GetConstantTensorsByRef() override
Retrieve the handles to the constant values stored by the layer.
virtual void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of FullyConnectedLayer.
ARMNN_NO_DEPRECATE_WARN_BEGIN void Accept(ILayerVisitor &visitor) const override
FullyConnectedLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
Copyright (c) 2021 ARM Limited and Contributors.
FullyConnectedLayer(const FullyConnectedDescriptor ¶m, const char *name)
Constructor to create a FullyConnectedLayer.
const FullyConnectedDescriptor & GetParameters() const override
const ConstTensorHandle * m_Bias
ARMNN_NO_DEPRECATE_WARN_END void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
uint32_t GetNumInputs(bool biasEnabled)
std::vector< std::reference_wrapper< std::shared_ptr< ConstTensorHandle > >> ConstantTensors
This layer represents a fully connected operation.
#define ARMNN_NO_DEPRECATE_WARN_END
std::shared_ptr< ConstTensorHandle > m_Weight
A unique pointer to store Weight values.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool m_BiasEnabled
Enable/disable bias.
#define ARMNN_ASSERT(COND)
const ConstTensorHandle * m_Weight
void SetAdditionalInfo(QueueDescriptor &descriptor) const
std::shared_ptr< ConstTensorHandle > m_Bias
A unique pointer to store Bias values.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
virtual const TensorInfo & GetTensorInfo() const =0
const char * GetName() const override
Returns the name of the layer.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const
const TensorInfo & GetTensorInfo() const override
ShapeInferenceMethod m_ShapeInferenceMethod
void FullyConnected(const TensorShape &rInputShape, Decoder< float > &rInputDecoder, const TensorShape &rOutputShape, Encoder< float > &rOutputEncoder, const TensorShape &rWeightsShape, Decoder< float > &rWeightDecoder, Decoder< float > *pBiasDecoder, const bool biasEnabled, const unsigned int K, const bool transposeWeights)
Performs a matrix multiplication and optionally adds a bias.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...