25 const std::vector<T>& inputData,
26 const std::vector<T>& outputExpectedData)
29 auto input = MakeTensor<T, 4>(inputTensorInfo, inputData);
32 ret.outputExpected = MakeTensor<T, 4>(outputTensorInfo, outputExpectedData);
34 std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.
CreateTensorHandle(inputTensorInfo);
35 std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.
CreateTensorHandle(outputTensorInfo);
40 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
41 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
43 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.
CreateTranspose(data, info);
45 inputHandle->Allocate();
46 outputHandle->Allocate();
57 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
65 unsigned int inputShape[] = { 1, 2, 2, 2 };
66 unsigned int outputShape[] = { 1, 2, 2, 2 };
77 if(armnn::IsQuantizedType<T>())
85 std::vector<T> input = armnnUtils::QuantizedVector<T>(
94 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
101 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager,
102 descriptor, inputTensorInfo,
103 outputTensorInfo, input, outputExpected);
106 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
114 unsigned int inputShape[] = { 1, 2, 2, 3 };
115 unsigned int outputShape[] = { 1, 3, 2, 2 };
126 if(armnn::IsQuantizedType<T>())
134 std::vector<T> input = armnnUtils::QuantizedVector<T>(
143 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
151 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager,
152 descriptor, inputTensorInfo,
153 outputTensorInfo, input, outputExpected);
156 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
164 unsigned int inputShape[] = { 1, 3, 2, 2 };
165 unsigned int outputShape[] = { 1, 2, 2, 3 };
176 if(armnn::IsQuantizedType<T>())
184 std::vector<T> input = armnnUtils::QuantizedVector<T>(
192 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
201 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager,
202 descriptor, inputTensorInfo,
203 outputTensorInfo, input, outputExpected);
206 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
214 unsigned int inputShape[] = { 1, 2, 3, 3 };
215 unsigned int outputShape[] = { 1, 3, 2, 3 };
226 if(armnn::IsQuantizedType<T>())
234 std::vector<T> input = armnnUtils::QuantizedVector<T>(
245 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
247 1, 11, 21, 31, 41, 51,
248 2, 12, 22, 32, 42, 52,
249 3, 13, 23, 33, 43, 53
253 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager,
254 descriptor, inputTensorInfo,
255 outputTensorInfo, input, outputExpected);
LayerTestResult< T, 4 > SimpleTransposeTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
void IgnoreUnused(Ts &&...)
LayerTestResult< T, 4 > TransposeValueSet2Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
virtual std::unique_ptr< IWorkload > CreateTranspose(const TransposeQueueDescriptor &descriptor, const WorkloadInfo &info) const
LayerDescriptor m_Parameters
LayerTestResult< T, 4 > SimpleTransposeTestImpl(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, armnn::TransposeDescriptor descriptor, armnn::TensorInfo inputTensorInfo, armnn::TensorInfo outputTensorInfo, const std::vector< T > &inputData, const std::vector< T > &outputExpectedData)
LayerTestResult< T, 4 > TransposeValueSet1Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
void SetQuantizationScale(float scale)
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0
A TransposeDescriptor for the TransposeLayer.
Contains information about inputs and outputs to a layer.
void SetQuantizationOffset(int32_t offset)
LayerTestResult< T, 4 > TransposeValueSet3Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)