39 layer->m_Param.m_KeepDims = m_Param.m_KeepDims;
41 return std::move(layer);
55 "MeanLayer: Mean supports up to 4D input.");
58 unsigned int outputRank = 0;
82 std::vector<unsigned int> dimSizes(outputRank, 1);
86 unsigned int outputIndex = 0;
96 dimSizes[outputIndex] = 1;
MeanDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of MeanLayer.
const TensorShape & GetShape() const
MeanLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Mean type.
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
Copyright (c) 2021 ARM Limited and Contributors.
MeanLayer(const MeanDescriptor ¶m, const char *name)
Constructor to create a MeanLayer.
const MeanDescriptor & GetParameters() const override
LayerDescriptor m_Parameters
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
#define ARMNN_ASSERT_MSG(COND, MSG)
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept...
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
void SetAdditionalInfo(QueueDescriptor &descriptor) const
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
A MeanDescriptor for the MeanLayer.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
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.
This layer represents a mean operation.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const
const TensorInfo & GetTensorInfo() const override
unsigned int GetNumDimensions() const
ShapeInferenceMethod m_ShapeInferenceMethod
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...