ArmNN
 21.02
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 QueueDescriptor
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
 
- Protected Member Functions inherited from QueueDescriptorWithParameters< DepthToSpaceDescriptor >
 ~QueueDescriptorWithParameters ()=default
 
 QueueDescriptorWithParameters ()=default
 
 QueueDescriptorWithParameters (QueueDescriptorWithParameters const &)=default
 
QueueDescriptorWithParametersoperator= (QueueDescriptorWithParameters const &)=default
 
- Protected Member Functions inherited from QueueDescriptor
 ~QueueDescriptor ()=default
 
 QueueDescriptor ()
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 651 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 3455 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, and armnn::QSymmS16.

3456 {
3457  const std::string descriptorName{"DepthToSpaceQueueDescriptor"};
3458 
3459  ValidateNumInputs(workloadInfo, descriptorName, 1);
3460  ValidateNumOutputs(workloadInfo, descriptorName, 1);
3461 
3462  const TensorInfo& inputInfo = workloadInfo.m_InputTensorInfos[0];
3463  const TensorInfo& outputInfo = workloadInfo.m_OutputTensorInfos[0];
3464 
3465  ValidateTensorNumDimensions(inputInfo, descriptorName, 4, "input");
3466  ValidateTensorNumDimensions(outputInfo, descriptorName, 4, "output");
3467 
3468  std::vector<DataType> supportedTypes =
3469  {
3476  };
3477 
3478  ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3479  ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3480 
3481  ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName, "input", "output");
3482 
3483  if (m_Parameters.m_BlockSize == 0)
3484  {
3485  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
3486  }
3487 
3488  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
3489  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
3490  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
3491  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
3492 
3493  const TensorShape& outputShape = outputInfo.GetShape();
3494  if (outputShape[hIndex] % m_Parameters.m_BlockSize != 0 || outputShape[wIndex] % m_Parameters.m_BlockSize != 0)
3495  {
3496  throw InvalidArgumentException(descriptorName + ": Output width and height shape"
3497  "must be divisible by block size.");
3498  }
3499 
3500  const TensorShape& inputShape = inputInfo.GetShape();
3501  if (inputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
3502  {
3503  throw InvalidArgumentException(descriptorName + ": The depth of the input tensor"
3504  "must be divisible by the square of block size." );
3505  }
3506 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
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.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).

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