15 template<
typename T,
size_t NumDims>
23 const std::vector<T>& inputData,
24 const std::vector<T>& outputExpectedData)
29 std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.
CreateTensorHandle(inputTensorInfo);
30 std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.
CreateTensorHandle(outputTensorInfo);
35 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
36 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
40 inputHandle->Allocate();
41 outputHandle->Allocate();
51 outputHandle->GetShape(),
56 template<armnn::DataType ArmnnType,
typename T>
65 unsigned int inputShape[] = { 1,9,1,1 };
66 unsigned int outputShape[] = { 1,9,1,1 };
77 auto input = ConvertToDataType<ArmnnType>(
79 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f
82 auto outputExpected = ConvertToDataType<ArmnnType>(
84 0.0f, 3.0f, 6.0f, 1.0f, 4.0f, 7.0f, 2.0f, 5.0f, 8.0f
88 return ChannelShuffleTestImpl<T, 4>(
99 template<armnn::DataType ArmnnType,
typename T>
108 unsigned int inputShape[] = { 3, 12 };
109 unsigned int outputShape[] = { 3, 12 };
120 auto input = ConvertToDataType<ArmnnType>(
122 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
123 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
124 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
128 auto outputExpected = ConvertToDataType<ArmnnType>(
130 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11,
131 12, 16, 20, 13, 17, 21, 14, 18, 22, 15, 19, 23,
132 24, 28, 32, 25, 29, 33, 26, 30, 34, 27, 31, 35
136 return ChannelShuffleTestImpl<T, 2>(
147 template<armnn::DataType ArmnnType,
typename T>
156 unsigned int inputShape[] = { 2, 9, 1, 2 };
157 unsigned int outputShape[] = { 2, 9, 1, 2 };
168 auto input = ConvertToDataType<ArmnnType>(
196 auto outputExpected = ConvertToDataType<ArmnnType>(
220 return ChannelShuffleTestImpl<T, 4>(
236 SimpleChannelShuffleTest<armnn::DataType::Float32>(
242 SimpleChannelShuffleTest<armnn::DataType::QAsymmU8>(
248 SimpleChannelShuffleTest<armnn::DataType::QAsymmS8>(
253 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2>
254 ChannelShuffle2DTest<armnn::DataType::Float32>(
259 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 2>
260 ChannelShuffle2DTest<armnn::DataType::QAsymmU8>(
265 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmS8>, 2>
266 ChannelShuffle2DTest<armnn::DataType::QAsymmS8>(
271 template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 4>
272 ChannelShuffle4DTest<armnn::DataType::Float32>(
277 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 4>
278 ChannelShuffle4DTest<armnn::DataType::QAsymmU8>(
283 template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmS8>, 4>
284 ChannelShuffle4DTest<armnn::DataType::QAsymmS8>(
const TensorShape & GetShape() const
LayerTestResult< T, 4 > SimpleChannelShuffleTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
LayerTestResult< T, 2 > ChannelShuffle2DTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void IgnoreUnused(Ts &&...)
LayerDescriptor m_Parameters
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
void SetQuantizationScale(float scale)
LayerTestResult< T, 4 > ChannelShuffle4DTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
uint32_t m_NumGroups
Number of groups for the channel shuffle operation.
virtual std::unique_ptr< IWorkload > CreateChannelShuffle(const ChannelShuffleQueueDescriptor &descriptor, const WorkloadInfo &info) const
uint32_t m_Axis
Axis to apply channel shuffle operation on.
Contains information about TensorInfos of a layer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
unsigned int GetNumElements() const
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)