37 layer->m_Param.m_KeepDims = m_Param.m_KeepDims;
38 layer->m_Param.m_ReduceOperation = m_Param.m_ReduceOperation;
40 return std::move(layer);
54 "ReduceLayer: Reduce supports up to 4D input.");
57 unsigned int outputRank = 0;
81 std::vector<unsigned int> dimSizes(outputRank, 1);
85 unsigned int outputIndex = 0;
95 dimSizes[outputIndex] = 1;
ReduceDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
const ReduceDescriptor & GetParameters() const
const TensorShape & GetShape() const
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ReduceLayer.
void Reduce(const TensorInfo &inputInfo, const TensorInfo &outputInfo, Decoder< float > &input, Encoder< float > &output, const std::vector< uint32_t > axis, const ReduceOperation reduceOperation)
bool m_KeepDims
if true then output shape has no change.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Reduce type.
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
Copyright (c) 2021 ARM Limited and Contributors.
This layer represents a reduction operation.
LayerDescriptor m_Parameters
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
ARMNN_NO_DEPRECATE_WARN_BEGIN void Accept(ILayerVisitor &visitor) const override
ReduceLayer(const ReduceDescriptor ¶m, const char *name)
Constructor to create a ReduceLayer.
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_NO_DEPRECATE_WARN_END
#define ARMNN_ASSERT_MSG(COND, MSG)
A ReduceDescriptor for the REDUCE operators.
virtual std::unique_ptr< IWorkload > CreateReduce(const ReduceQueueDescriptor &descriptor, const WorkloadInfo &info) const
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
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.
ReduceLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
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...