ArmNN
 22.11
SpaceToDepthQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for SpaceToDepthQueueDescriptor:
QueueDescriptorWithParameters< SpaceToDepthDescriptor > QueueDescriptor

Public Member Functions

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

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 1878 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().

1879 {
1880  const std::string descriptorName{"SpaceToDepthQueueDescriptor"};
1881 
1882  ValidateNumInputs(workloadInfo, descriptorName, 1);
1883  ValidateNumOutputs(workloadInfo, descriptorName, 1);
1884 
1885  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
1886  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
1887 
1888  ValidateTensorNumDimensions(inputTensorInfo, descriptorName, 4, "input");
1889  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, 4, "output");
1890 
1891  std::vector<DataType> supportedTypes =
1892  {
1899  };
1900 
1901  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1902  ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1903 
1904  ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
1905 
1906  if (m_Parameters.m_BlockSize == 0)
1907  {
1908  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
1909  }
1910 
1911  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
1912  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
1913  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
1914  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
1915 
1916  const TensorShape& inputShape = inputTensorInfo.GetShape();
1917  if (inputShape[hIndex] % m_Parameters.m_BlockSize != 0 || inputShape[wIndex] % m_Parameters.m_BlockSize != 0)
1918  {
1919  throw InvalidArgumentException(descriptorName + ": Input shape must be divisible "
1920  "by block size in all spatial dimensions");
1921  }
1922 
1923  const TensorShape& outputShape = outputTensorInfo.GetShape();
1924  if (outputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
1925  {
1926  throw InvalidArgumentException(descriptorName + ": The depth of the output tensor"
1927  "must be divisible by the square of block size." );
1928  }
1929 }
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: