27 const std::vector<T>& inputData,
28 const std::vector<T>& outputExpectedData)
31 auto input = MakeTensor<T, 4>(inputTensorInfo, inputData);
34 ret.outputExpected = MakeTensor<T, 4>(outputTensorInfo, outputExpectedData);
36 std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.
CreateTensorHandle(inputTensorInfo);
37 std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.
CreateTensorHandle(outputTensorInfo);
42 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
43 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
45 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.
CreateTranspose(data, info);
47 inputHandle->Allocate();
48 outputHandle->Allocate();
59 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
68 unsigned int inputShape[] = { 1, 2, 2, 2 };
69 unsigned int outputShape[] = { 1, 2, 2, 2 };
80 if(armnn::IsQuantizedType<T>())
88 std::vector<T> input = armnnUtils::QuantizedVector<T>(
97 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
105 descriptor, inputTensorInfo,
106 outputTensorInfo, input, outputExpected);
109 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
118 unsigned int inputShape[] = { 1, 2, 2, 3 };
119 unsigned int outputShape[] = { 1, 3, 2, 2 };
130 if(armnn::IsQuantizedType<T>())
138 std::vector<T> input = armnnUtils::QuantizedVector<T>(
147 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
155 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
156 descriptor, inputTensorInfo,
157 outputTensorInfo, input, outputExpected);
160 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
169 unsigned int inputShape[] = { 1, 3, 2, 2 };
170 unsigned int outputShape[] = { 1, 2, 2, 3 };
181 if(armnn::IsQuantizedType<T>())
189 std::vector<T> input = armnnUtils::QuantizedVector<T>(
197 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
206 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
207 descriptor, inputTensorInfo,
208 outputTensorInfo, input, outputExpected);
211 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
220 unsigned int inputShape[] = { 1, 2, 3, 3 };
221 unsigned int outputShape[] = { 1, 3, 2, 3 };
232 if(armnn::IsQuantizedType<T>())
240 std::vector<T> input = armnnUtils::QuantizedVector<T>(
251 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
253 1, 11, 21, 31, 41, 51,
254 2, 12, 22, 32, 42, 52,
255 3, 13, 23, 33, 43, 53
259 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
260 descriptor, inputTensorInfo,
261 outputTensorInfo, input, outputExpected);
LayerTestResult< T, 4 > SimpleTransposeTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
LayerTestResult< T, 4 > TransposeValueSet2Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void IgnoreUnused(Ts &&...)
virtual std::unique_ptr< IWorkload > CreateTranspose(const TransposeQueueDescriptor &descriptor, const WorkloadInfo &info) const
LayerDescriptor m_Parameters
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
LayerTestResult< T, 4 > TransposeValueSet1Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void SetQuantizationScale(float scale)
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
LayerTestResult< T, 4 > TransposeValueSet3Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
A TransposeDescriptor for the TransposeLayer.
Contains information about inputs and outputs to a layer.
void SetQuantizationOffset(int32_t offset)
LayerTestResult< T, 4 > SimpleTransposeTestImpl(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, armnn::TransposeDescriptor descriptor, armnn::TensorInfo inputTensorInfo, armnn::TensorInfo outputTensorInfo, const std::vector< T > &inputData, const std::vector< T > &outputExpectedData)
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
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)