36 layer->m_Param.m_KeepDims = m_Param.m_KeepDims;
38 return std::move(layer);
48 "MeanLayer: Mean supports up to 4D input.");
51 unsigned int outputRank = 0;
75 std::vector<unsigned int> dimSizes(outputRank, 1);
79 unsigned int outputIndex = 0;
89 dimSizes[outputIndex] = 1;
96 ConditionalThrowIfNotEqual<LayerValidationException>(
97 "MeanLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
MeanDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
const MeanDescriptor & GetParameters() const
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.
Copyright (c) 2020 ARM Limited.
MeanLayer(const MeanDescriptor ¶m, const char *name)
Constructor to create a MeanLayer.
LayerDescriptor m_Parameters
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
virtual void VisitMeanLayer(const IConnectableLayer *layer, const MeanDescriptor &meanDescriptor, const char *name=nullptr)=0
Function a Mean layer should call back to when its Accept(ILayerVisitor&) function is invoked...
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.
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept...
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
virtual std::unique_ptr< IWorkload > CreateMean(const MeanQueueDescriptor &descriptor, const WorkloadInfo &Info) const
A MeanDescriptor for the MeanLayer.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
void Mean(const armnn::TensorInfo &inputInfo, const armnn::TensorInfo &outputInfo, const std::vector< unsigned int > &axis, Decoder< float > &input, Encoder< float > &output)
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.
const TensorInfo & GetTensorInfo() const override
unsigned int GetNumDimensions() const