ArmNN
 20.08
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 633 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

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

3415 {
3416  const std::string descriptorName{"DepthToSpaceQueueDescriptor"};
3417 
3418  ValidateNumInputs(workloadInfo, descriptorName, 1);
3419  ValidateNumOutputs(workloadInfo, descriptorName, 1);
3420 
3421  const TensorInfo& inputInfo = workloadInfo.m_InputTensorInfos[0];
3422  const TensorInfo& outputInfo = workloadInfo.m_OutputTensorInfos[0];
3423 
3424  ValidateTensorNumDimensions(inputInfo, descriptorName, 4, "input");
3425  ValidateTensorNumDimensions(outputInfo, descriptorName, 4, "output");
3426 
3427  std::vector<DataType> supportedTypes =
3428  {
3435  };
3436 
3437  ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
3438  ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
3439 
3440  ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName, "input", "output");
3441 
3442  if (m_Parameters.m_BlockSize == 0)
3443  {
3444  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
3445  }
3446 
3447  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
3448  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
3449  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
3450  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
3451 
3452  const TensorShape& outputShape = outputInfo.GetShape();
3453  if (outputShape[hIndex] % m_Parameters.m_BlockSize != 0 || outputShape[wIndex] % m_Parameters.m_BlockSize != 0)
3454  {
3455  throw InvalidArgumentException(descriptorName + ": Output width and height shape"
3456  "must be divisible by block size.");
3457  }
3458 
3459  const TensorShape& inputShape = inputInfo.GetShape();
3460  if (inputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
3461  {
3462  throw InvalidArgumentException(descriptorName + ": The depth of the input tensor"
3463  "must be divisible by the square of block size." );
3464  }
3465 }
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: