24.08
|
Go to the documentation of this file.
39 if (inputShapes.size() != 1)
42 "\" - should be \"1\".");
51 if (unsignedAxis > inputNumDimensions)
54 + std::to_string(unsignedAxis) +
56 + std::to_string(inputNumDimensions) +
"\").");
62 std::vector<unsigned int> tensorDimensions(1, 1);
63 TensorShape outputShape(1, tensorDimensions.data());
65 return std::vector<TensorShape>({ outputShape });
68 std::vector<unsigned int> tensorDimensions(inputNumDimensions - 1, 0);
69 for (
unsigned int i = 0; i < unsignedAxis; ++i)
71 tensorDimensions[i] = inputShape[i];
74 for (
unsigned int i = unsignedAxis + 1; i < inputNumDimensions; ++i)
76 tensorDimensions[i - 1] = inputShape[i];
81 return std::vector<TensorShape>({ outputShape });
94 if (inferredShapes.size() != 1)
97 + std::to_string(inferredShapes.size()) +
98 " elements - should only have 1.");
ArgMinMaxLayer * 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 ArgMinMax type.
ArgMinMaxLayer(const ArgMinMaxDescriptor ¶m, const char *name)
Constructor to create a ArgMinMaxLayer.
const TensorInfo & GetTensorInfo() const override
An ArgMinMaxDescriptor for ArgMinMaxLayer.
unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis)
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
This layer represents a ArgMinMax operation.
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
const ArgMinMaxDescriptor & GetParameters() const override
const char * GetName() const override
Returns the name of the layer.
ArgMinMaxDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
void ArgMinMax(Decoder< float > &in, OUT *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
void SetAdditionalInfo(QueueDescriptor &descriptor) const
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ArgMinMaxLayer.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shape from a given input shape and axis parameter.
const TensorShape & GetShape() const
Copyright (c) 2021 ARM Limited and Contributors.
int m_Axis
Axis to reduce across the input tensor.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
ShapeInferenceMethod m_ShapeInferenceMethod
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
Backends should implement their own CreateWorkload function with a switch statement.
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