ArmNN
 24.08
ResizeQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

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

Public Member Functions

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

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 1578 of file WorkloadData.cpp.

1579 {
1580  const std::string descriptorName{"ResizeQueueDescriptor"};
1581 
1582  ValidateNumInputs(workloadInfo, descriptorName, 1);
1583  ValidateNumOutputs(workloadInfo, descriptorName, 1);
1584 
1585  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
1586  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
1587 
1588  ValidateTensorNumDimensions(inputTensorInfo, descriptorName, 4, "input");
1589  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, 4, "output");
1590 
1591  std::vector<DataType> supportedTypes =
1592  {
1600  };
1601 
1602  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1603  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
1604 
1605  // Resize only changes width and height: batch and channel count must match.
1606  const unsigned int inputBatchSize = inputTensorInfo.GetShape()[0];
1607  const unsigned int outputBatchSize = outputTensorInfo.GetShape()[0];
1608  if (inputBatchSize != outputBatchSize)
1609  {
1611  fmt::format("{}: Input batch size ({}) does not match output batch size ({})",
1612  descriptorName, inputBatchSize, outputBatchSize));
1613  }
1614 
1615  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
1616  const unsigned int inputChannelCount = inputTensorInfo.GetShape()[dimensionIndices.GetChannelsIndex()];
1617  const unsigned int outputChannelCount = outputTensorInfo.GetShape()[dimensionIndices.GetChannelsIndex()];
1618  if (inputChannelCount != outputChannelCount)
1619  {
1621  fmt::format("{}: Input channel count ({}) does not match output channel count ({})",
1622  descriptorName, inputChannelCount, outputChannelCount));
1623  }
1624 }

References armnn::BFloat16, armnn::Float16, armnn::Float32, DataLayoutIndexed::GetChannelsIndex(), TensorInfo::GetShape(), ResizeDescriptor::m_DataLayout, WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, QueueDescriptorWithParameters< ResizeDescriptor >::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
armnnUtils::DataLayoutIndexed
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout.
Definition: DataLayoutIndexed.hpp:17
armnn::DataType::Float32
@ Float32
armnn::ResizeDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition: Descriptors.hpp:1014
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::DataType::QSymmS8
@ QSymmS8
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::DataType::Float16
@ Float16
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::QueueDescriptorWithParameters< ResizeDescriptor >::m_Parameters
ResizeDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::TensorInfo::GetShape
const TensorShape & GetShape() const
Definition: Tensor.hpp:193
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