ArmNN
 24.02
MeanQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for MeanQueueDescriptor:
[legend]
Collaboration diagram for MeanQueueDescriptor:
[legend]

Public Member Functions

void Validate (const WorkloadInfo &workloadInfo) const
 
- Public Member Functions inherited from QueueDescriptorWithParameters< MeanDescriptor >
virtual ~QueueDescriptorWithParameters ()=default
 
- Public Member Functions inherited from QueueDescriptor
virtual ~QueueDescriptor ()=default
 
void ValidateTensorNumDimensions (const TensorInfo &tensor, std::string const &descName, unsigned int numDimensions, std::string const &tensorName) const
 
void ValidateTensorNumDimNumElem (const TensorInfo &tensorInfo, unsigned int numDimension, unsigned int numElements, std::string const &tensorName) const
 
void ValidateInputsOutputs (const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
 
template<typename T >
const T * GetAdditionalInformation () const
 

Additional Inherited Members

- Public Attributes inherited from QueueDescriptorWithParameters< MeanDescriptor >
MeanDescriptor m_Parameters
 
- Public Attributes inherited from QueueDescriptor
std::vector< ITensorHandle * > m_Inputs
 
std::vector< ITensorHandle * > m_Outputs
 
void * m_AdditionalInfoObject
 
bool m_AllowExpandedDims = false
 
- Protected Member Functions inherited from QueueDescriptorWithParameters< MeanDescriptor >
 QueueDescriptorWithParameters ()=default
 
 QueueDescriptorWithParameters (QueueDescriptorWithParameters const &)=default
 
QueueDescriptorWithParametersoperator= (QueueDescriptorWithParameters const &)=default
 
- Protected Member Functions inherited from QueueDescriptor
 QueueDescriptor ()
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 288 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 2429 of file WorkloadData.cpp.

2430 {
2431  const std::string descriptorName{"MeanQueueDescriptor"};
2432 
2433  ValidateNumInputs(workloadInfo, descriptorName, 1);
2434  ValidateNumOutputs(workloadInfo, descriptorName, 1);
2435 
2436  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
2437  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
2438 
2439  std::vector<DataType> supportedTypes =
2440  {
2447  };
2448 
2449  // First check if input tensor data type is supported, then
2450  // check if this data type matches the output tensor data type
2451  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2452  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
2453 
2455  {
2456  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, inputTensorInfo.GetNumDimensions(), "output");
2457  }
2458  else if (m_Parameters.m_Axis.empty())
2459  {
2460  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, 1, "output");
2461  }
2462  else
2463  {
2464  unsigned int outputDim =
2465  inputTensorInfo.GetNumDimensions() - armnn::numeric_cast<unsigned int>(m_Parameters.m_Axis.size());
2466  ValidateTensorNumDimensions(outputTensorInfo,
2467  descriptorName,
2468  outputDim > 0 ? outputDim : 1,
2469  "output");
2470  }
2471 }

References armnn::BFloat16, armnn::Float16, armnn::Float32, TensorInfo::GetNumDimensions(), MeanDescriptor::m_Axis, WorkloadInfo::m_InputTensorInfos, MeanDescriptor::m_KeepDims, WorkloadInfo::m_OutputTensorInfos, QueueDescriptorWithParameters< MeanDescriptor >::m_Parameters, armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS16, and QueueDescriptor::ValidateTensorNumDimensions().


The documentation for this struct was generated from the following files:
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::TensorInfo::GetNumDimensions
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:197
armnn::DataType::Float32
@ Float32
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::MeanDescriptor::m_KeepDims
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept.
Definition: Descriptors.hpp:1192
armnn::DataType::Float16
@ Float16
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::QueueDescriptorWithParameters< MeanDescriptor >::m_Parameters
MeanDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::MeanDescriptor::m_Axis
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
Definition: Descriptors.hpp:1190
armnn::WorkloadInfo::m_InputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
Definition: WorkloadInfo.hpp:18
armnn::QueueDescriptor::ValidateTensorNumDimensions
void ValidateTensorNumDimensions(const TensorInfo &tensor, std::string const &descName, unsigned int numDimensions, std::string const &tensorName) const
Definition: WorkloadData.cpp:397