ArmNN
 24.08
PadQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

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

Public Member Functions

void Validate (const WorkloadInfo &workloadInfo) const
 
- Public Member Functions inherited from QueueDescriptorWithParameters< PadDescriptor >
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< PadDescriptor >
PadDescriptor 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< PadDescriptor >
 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 294 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 2477 of file WorkloadData.cpp.

2478 {
2479  const std::string descriptorName{"PadQueueDescriptor"};
2480 
2481  ValidateNumInputs(workloadInfo, descriptorName, 1);
2482  ValidateNumOutputs(workloadInfo, descriptorName, 1);
2483 
2484  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
2485  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
2486 
2487  // input and output should have the same number of dimensions
2488  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, inputTensorInfo.GetNumDimensions(), "output");
2489 
2490  // there should be entry in the pad list for each dimension in the input tensor
2491  if (m_Parameters.m_PadList.size() != inputTensorInfo.GetNumDimensions()) {
2492  throw InvalidArgumentException(descriptorName + ":Pad List should contain the same number of entries "
2493  "as there are dimensions in the input tensor that is " +
2494  std::to_string(inputTensorInfo.GetNumDimensions()) + " entries " +
2495  " not " + std::to_string(m_Parameters.m_PadList.size()) + " entries.");
2496  }
2497 }

References TensorInfo::GetNumDimensions(), WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, PadDescriptor::m_PadList, QueueDescriptorWithParameters< PadDescriptor >::m_Parameters, 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::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::QueueDescriptorWithParameters< PadDescriptor >::m_Parameters
PadDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::PadDescriptor::m_PadList
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding for input dimension.
Definition: Descriptors.hpp:1218
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