ArmNN  NotReleased
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 554 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 2933 of file WorkloadData.cpp.

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

2934 {
2935  const std::string descriptorName{"DepthToSpaceQueueDescriptor"};
2936 
2937  ValidateNumInputs(workloadInfo, descriptorName, 1);
2938  ValidateNumOutputs(workloadInfo, descriptorName, 1);
2939 
2940  const TensorInfo& inputInfo = workloadInfo.m_InputTensorInfos[0];
2941  const TensorInfo& outputInfo = workloadInfo.m_OutputTensorInfos[0];
2942 
2943  ValidateTensorNumDimensions(inputInfo, descriptorName, 4, "input");
2944  ValidateTensorNumDimensions(outputInfo, descriptorName, 4, "output");
2945 
2946  std::vector<DataType> supportedTypes =
2947  {
2952  };
2953 
2954  ValidateDataTypes(inputInfo, supportedTypes, descriptorName);
2955  ValidateDataTypes(outputInfo, supportedTypes, descriptorName);
2956 
2957  ValidateTensorNumElementsMatch(inputInfo, outputInfo, descriptorName, "input", "output");
2958 
2959  if (m_Parameters.m_BlockSize == 0)
2960  {
2961  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
2962  }
2963 
2964  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
2965  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
2966  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
2967  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
2968 
2969  const TensorShape& outputShape = outputInfo.GetShape();
2970  if (outputShape[hIndex] % m_Parameters.m_BlockSize != 0 || outputShape[wIndex] % m_Parameters.m_BlockSize != 0)
2971  {
2972  throw InvalidArgumentException(descriptorName + ": Output width and height shape"
2973  "must be divisible by block size.");
2974  }
2975 
2976  const TensorShape& inputShape = inputInfo.GetShape();
2977  if (inputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
2978  {
2979  throw InvalidArgumentException(descriptorName + ": The depth of the input tensor"
2980  "must be divisible by the square of block size." );
2981  }
2982 }
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< TensorInfo > m_OutputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
const TensorShape & GetShape() const
Definition: Tensor.hpp:88

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