50 if (inputShape.GetNumDimensions() == 1)
52 std::vector<unsigned int> tensorDimensions(1, 1);
53 TensorShape outputShape(1, tensorDimensions.data());
55 return std::vector<TensorShape>({ outputShape });
58 std::vector<unsigned int> tensorDimensions(inputNumDimensions - 1, 0);
59 for (
unsigned int i = 0; i < unsignedAxis; ++i)
61 tensorDimensions[i] = inputShape[i];
64 for (
unsigned int i = unsignedAxis + 1; i < inputNumDimensions; ++i)
66 tensorDimensions[i - 1] = inputShape[i];
71 return std::vector<TensorShape>({ outputShape });
ArgMinMaxDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
const ArgMinMaxDescriptor & GetParameters() const
const TensorShape & GetShape() const
virtual std::unique_ptr< IWorkload > CreateArgMinMax(const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info) const
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
ArgMinMaxLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
void ArgMinMax(Decoder< float > &in, OUT *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
Copyright (c) 2020 ARM Limited.
ArgMinMaxLayer(const ArgMinMaxDescriptor ¶m, const char *name)
Constructor to create a ArgMinMaxLayer.
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
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.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis)
This layer represents a ArgMinMax operation.
#define ARMNN_ASSERT(COND)
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the ArgMinMax type.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
virtual const TensorInfo & GetTensorInfo() const =0
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ArgMinMaxLayer.
int m_Axis
Axis to reduce across the input tensor.
const char * GetName() const override
Returns the name of the layer.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shape from a given input shape and axis parameter.
const TensorInfo & GetTensorInfo() const override
ShapeInferenceMethod m_ShapeInferenceMethod
virtual void VisitArgMinMaxLayer(const IConnectableLayer *layer, const ArgMinMaxDescriptor &argMinMaxDescriptor, const char *name=nullptr)=0
Function that an arg min max layer should call back to when its Accept(ILayerVisitor&) function is in...