ArmNN
 24.02
ReverseV2QueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for ReverseV2QueueDescriptor:
[legend]
Collaboration diagram for ReverseV2QueueDescriptor:
[legend]

Public Member Functions

void Validate (const WorkloadInfo &workloadInfo) const
 
- 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 QueueDescriptor
std::vector< ITensorHandle * > m_Inputs
 
std::vector< ITensorHandle * > m_Outputs
 
void * m_AdditionalInfoObject
 
bool m_AllowExpandedDims = false
 
- Protected Member Functions inherited from QueueDescriptor
 QueueDescriptor ()
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 758 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 1623 of file WorkloadData.cpp.

1624 {
1625  const std::string descriptorName{"ReverseV2QueueDescriptor"};
1626 
1627  // Backend restriction
1628  const unsigned int maxDimensions = 4;
1629 
1630  ValidateNumInputs(workloadInfo, descriptorName, 2);
1631  ValidateNumOutputs(workloadInfo, descriptorName, 1);
1632 
1633  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
1634  const TensorInfo& axisTensorInfo = workloadInfo.m_InputTensorInfos[1];
1635  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
1636 
1637  const auto inputTensorNumDimensions = inputTensorInfo.GetNumDimensions();
1638  if (inputTensorNumDimensions > maxDimensions)
1639  {
1640  throw InvalidArgumentException(descriptorName +
1641  ": Input tensors with rank greater than " +
1642  std::to_string(maxDimensions) + " are not supported.");
1643  }
1644 
1645  const auto axisTensorNumDimensions = axisTensorInfo.GetNumDimensions();
1646  if (axisTensorNumDimensions > maxDimensions)
1647  {
1648  throw InvalidArgumentException(descriptorName +
1649  ": More than " + std::to_string(maxDimensions) + " axes cannot be specified.");
1650  }
1651 
1652  if (axisTensorNumDimensions > inputTensorNumDimensions)
1653  {
1654  throw InvalidArgumentException(descriptorName +
1655  ": More axes specified than the number of axes on the input tensor.");
1656  }
1657 
1658  std::vector<DataType> supportedTypes =
1659  {
1668  };
1669 
1670  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
1671 
1672  std::vector<DataType> axisSupportedTypes =
1673  {
1675  };
1676 
1677  ValidateDataTypes(axisTensorInfo, axisSupportedTypes, descriptorName);
1678 
1679  ValidateTensorShapesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
1680  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
1681 }

References armnn::BFloat16, armnn::Float16, armnn::Float32, TensorInfo::GetNumDimensions(), WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS16, armnn::QSymmS8, and armnn::Signed32.


The documentation for this struct was generated from the following files:
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::TensorInfo::GetNumDimensions
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:197
armnn::DataType::Float32
@ Float32
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::DataType::QSymmS8
@ QSymmS8
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::DataType::Float16
@ Float16
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::DataType::Signed32
@ Signed32
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::WorkloadInfo::m_InputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
Definition: WorkloadInfo.hpp:18