ArmNN
 24.02
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 1575 of file WorkloadData.cpp.

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

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:397