ArmNN
 22.05
DepthToSpaceQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for DepthToSpaceQueueDescriptor:
QueueDescriptorWithParameters< DepthToSpaceDescriptor > QueueDescriptor

Public Member Functions

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

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 3687 of file WorkloadData.cpp.

References armnn::BFloat16, armnn::Float16, armnn::Float32, DataLayoutIndexed::GetChannelsIndex(), DataLayoutIndexed::GetHeightIndex(), TensorInfo::GetShape(), DataLayoutIndexed::GetWidthIndex(), WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS16, and QueueDescriptor::ValidateTensorNumDimensions().

3688 {
3689  const std::string descriptorName{"DepthToSpaceQueueDescriptor"};
3690 
3691  ValidateNumInputs(workloadInfo, descriptorName, 1);
3692  ValidateNumOutputs(workloadInfo, descriptorName, 1);
3693 
3694  const TensorInfo& inputInfo = workloadInfo.m_InputTensorInfos[0];
3695  const TensorInfo& outputInfo = workloadInfo.m_OutputTensorInfos[0];
3696 
3697  ValidateTensorNumDimensions(inputInfo, descriptorName, 4, "input");
3698  ValidateTensorNumDimensions(outputInfo, descriptorName, 4, "output");
3699 
3700  std::vector<DataType> supportedTypes =
3701  {
3708  };
3709 
3710  ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3711  ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3712 
3713  ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName, "input", "output");
3714 
3715  if (m_Parameters.m_BlockSize == 0)
3716  {
3717  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
3718  }
3719 
3720  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
3721  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
3722  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
3723  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
3724 
3725  const TensorShape& outputShape = outputInfo.GetShape();
3726  if (outputShape[hIndex] % m_Parameters.m_BlockSize != 0 || outputShape[wIndex] % m_Parameters.m_BlockSize != 0)
3727  {
3728  throw InvalidArgumentException(descriptorName + ": Output width and height shape"
3729  "must be divisible by block size.");
3730  }
3731 
3732  const TensorShape& inputShape = inputInfo.GetShape();
3733  if (inputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
3734  {
3735  throw InvalidArgumentException(descriptorName + ": The depth of the input tensor"
3736  "must be divisible by the square of block size." );
3737  }
3738 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:191
std::vector< TensorInfo > m_InputTensorInfos
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout...
std::vector< TensorInfo > m_OutputTensorInfos
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
void ValidateTensorNumDimensions(const TensorInfo &tensor, std::string const &descName, unsigned int numDimensions, std::string const &tensorName) const
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).

The documentation for this struct was generated from the following files: