ArmNN
 24.08
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 2432 of file WorkloadData.cpp.

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

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, armnn::QSymmS8, 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::QSymmS8
@ QSymmS8
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:398