ArmNN
 24.02
StridedSliceQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

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

Public Member Functions

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

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 2584 of file WorkloadData.cpp.

2585 {
2586  const std::string descriptorName{"StridedSliceQueueDescriptor"};
2587 
2588  ValidateNumInputs(workloadInfo, descriptorName, 1);
2589  ValidateNumOutputs(workloadInfo, descriptorName, 1);
2590 
2591  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
2592  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
2593 
2594  std::vector<DataType> supportedTypes =
2595  {
2602  };
2603 
2604  ValidateDataTypes(inputTensorInfo, supportedTypes, descriptorName);
2605  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
2606 
2607  ValidateTensorQuantizationSpace(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
2608 
2609  const uint32_t rank = inputTensorInfo.GetNumDimensions();
2610  if (rank > 4)
2611  {
2612  throw InvalidArgumentException(descriptorName + ": Input tensors with rank greater than 4 are not supported.");
2613  }
2614 
2615  // Begin, End & Stride length must be of rank(input0)
2616  if (m_Parameters.m_Begin.size() != rank)
2617  {
2618  throw InvalidArgumentException(descriptorName + ": Begin length must be of rank " + std::to_string(rank));
2619  }
2620 
2621  if (m_Parameters.m_End.size() != rank)
2622  {
2623  throw InvalidArgumentException(descriptorName + ": End length must be of rank " + std::to_string(rank));
2624  }
2625 
2626  if (m_Parameters.m_Stride.size() != rank)
2627  {
2628  throw InvalidArgumentException(descriptorName + ": Stride length must be of rank " + std::to_string(rank));
2629  }
2630 
2631  // Stride entries must be non-zero
2632  for (auto& stride : m_Parameters.m_Stride)
2633  {
2634  if (stride == 0)
2635  {
2636  throw InvalidArgumentException(descriptorName + ": Stride entries must be non-zero.");
2637  }
2638  }
2639 }

References armnn::BFloat16, armnn::Float16, armnn::Float32, TensorInfo::GetNumDimensions(), StridedSliceDescriptor::m_Begin, StridedSliceDescriptor::m_End, WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, QueueDescriptorWithParameters< StridedSliceDescriptor >::m_Parameters, StridedSliceDescriptor::m_Stride, armnn::QAsymmS8, armnn::QAsymmU8, and armnn::QSymmS16.


The documentation for this struct was generated from the following files:
armnn::StridedSliceDescriptor::m_Begin
std::vector< int > m_Begin
Begin values for the input that will be sliced.
Definition: Descriptors.hpp:1342
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::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::DataType::Float16
@ Float16
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::QueueDescriptorWithParameters< StridedSliceDescriptor >::m_Parameters
StridedSliceDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::StridedSliceDescriptor::m_Stride
std::vector< int > m_Stride
Stride values for the input that will be sliced.
Definition: Descriptors.hpp:1346
armnn::WorkloadInfo::m_InputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
Definition: WorkloadInfo.hpp:18
armnn::StridedSliceDescriptor::m_End
std::vector< int > m_End
End values for the input that will be sliced.
Definition: Descriptors.hpp:1344