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;
84 dimSizes[outputIndex] = boost::numeric_cast<
unsigned int>(input.
GetShape()[i]);
89 dimSizes[outputIndex] = 1;
96 ConditionalThrowIfNotEqual<LayerValidationException>(
97 "MeanLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
const char * GetName() const override
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
virtual const TensorInfo & GetTensorInfo() const =0
unsigned int GetNumDimensions() const
LayerDescriptor m_Parameters
virtual std::unique_ptr< IWorkload > CreateMean(const MeanQueueDescriptor &descriptor, const WorkloadInfo &Info) const
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept...
void ValidateTensorShapesFromInputs() override
const MeanDescriptor & GetParameters() const
void Mean(const armnn::TensorInfo &inputInfo, const armnn::TensorInfo &outputInfo, const std::vector< unsigned int > &axis, Decoder< float > &input, Encoder< float > &output)
MeanLayer(const MeanDescriptor ¶m, const char *name)
MeanDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
virtual void VisitMeanLayer(const IConnectableLayer *layer, const MeanDescriptor &meanDescriptor, const char *name=nullptr)=0
MeanLayer * Clone(Graph &graph) const override
This layer represents a mean operation.
A MeanDescriptor for the MeanLayer.
const TensorShape & GetShape() const
const TensorInfo & GetTensorInfo() const override
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
void Accept(ILayerVisitor &visitor) const override
const InputSlot & GetInputSlot(unsigned int index) const override