ArmNN  NotReleased
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 QueueDescriptor
void ValidateInputsOutputs (const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) 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
 
- Protected Member Functions inherited from QueueDescriptorWithParameters< SpaceToDepthDescriptor >
 ~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 348 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

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

1646 {
1647  const std::string descriptorName{"SpaceToDepthQueueDescriptor"};
1648 
1649  ValidateNumInputs(workloadInfo, descriptorName, 1);
1650  ValidateNumOutputs(workloadInfo, descriptorName, 1);
1651 
1652  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
1653  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
1654 
1655  ValidateTensorNumDimensions(inputTensorInfo, descriptorName, 4, "input");
1656  ValidateTensorNumDimensions(outputTensorInfo, descriptorName, 4, "output");
1657 
1658  std::vector<DataType> supportedTypes =
1659  {
1664  };
1665 
1666  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1667  ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
1668 
1669  ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
1670 
1671  if (m_Parameters.m_BlockSize == 0)
1672  {
1673  throw InvalidArgumentException(descriptorName + ": Block size cannot be 0.");
1674  }
1675 
1676  DataLayoutIndexed dimensionIndices(m_Parameters.m_DataLayout);
1677  const unsigned int wIndex = dimensionIndices.GetWidthIndex();
1678  const unsigned int hIndex = dimensionIndices.GetHeightIndex();
1679  const unsigned int cIndex = dimensionIndices.GetChannelsIndex();
1680 
1681  const TensorShape& inputShape = inputTensorInfo.GetShape();
1682  if (inputShape[hIndex] % m_Parameters.m_BlockSize != 0 || inputShape[wIndex] % m_Parameters.m_BlockSize != 0)
1683  {
1684  throw InvalidArgumentException(descriptorName + ": Input shape must be divisible "
1685  "by block size in all spatial dimensions");
1686  }
1687 
1688  const TensorShape& outputShape = outputTensorInfo.GetShape();
1689  if (outputShape[cIndex] % (m_Parameters.m_BlockSize * m_Parameters.m_BlockSize) != 0)
1690  {
1691  throw InvalidArgumentException(descriptorName + ": The depth of the output tensor"
1692  "must be divisible by the square of block size." );
1693  }
1694 }
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: