ArmNN
 20.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 QueueDescriptor
void ValidateInputsOutputs (const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) 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
 
- 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 ()=default
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 622 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 3386 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.

3387 {
3388  const std::string descriptorName{"DepthToSpaceQueueDescriptor"};
3389 
3390  ValidateNumInputs(workloadInfo, descriptorName, 1);
3391  ValidateNumOutputs(workloadInfo, descriptorName, 1);
3392 
3393  const TensorInfo& inputInfo = workloadInfo.m_InputTensorInfos[0];
3394  const TensorInfo& outputInfo = workloadInfo.m_OutputTensorInfos[0];
3395 
3396  ValidateTensorNumDimensions(inputInfo, descriptorName, 4, "input");
3397  ValidateTensorNumDimensions(outputInfo, descriptorName, 4, "output");
3398 
3399  std::vector<DataType> supportedTypes =
3400  {
3407  };
3408 
3409  ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3410  ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3411 
3412  ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName, "input", "output");
3413 
3414  if (m_Parameters.m_BlockSize == 0)
3415  {
3416  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
3417  }
3418 
3419  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
3420  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
3421  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
3422  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
3423 
3424  const TensorShape& outputShape = outputInfo.GetShape();
3425  if (outputShape[hIndex] % m_Parameters.m_BlockSize != 0 || outputShape[wIndex] % m_Parameters.m_BlockSize != 0)
3426  {
3427  throw InvalidArgumentException(descriptorName + ": Output width and height shape"
3428  "must be divisible by block size.");
3429  }
3430 
3431  const TensorShape& inputShape = inputInfo.GetShape();
3432  if (inputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
3433  {
3434  throw InvalidArgumentException(descriptorName + ": The depth of the input tensor"
3435  "must be divisible by the square of block size." );
3436  }
3437 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
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: