26 const std::vector<T>& inputData,
27 const std::vector<T>& outputExpectedData)
30 auto input = MakeTensor<T, 4>(inputTensorInfo, inputData);
33 ret.outputExpected = MakeTensor<T, 4>(outputTensorInfo, outputExpectedData);
35 std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.
CreateTensorHandle(inputTensorInfo);
36 std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.
CreateTensorHandle(outputTensorInfo);
41 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
42 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
44 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.
CreatePermute(data, info);
46 inputHandle->Allocate();
47 outputHandle->Allocate();
58 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
67 unsigned int inputShape[] = { 1, 2, 2, 2 };
68 unsigned int outputShape[] = { 1, 2, 2, 2 };
79 if(armnn::IsQuantizedType<T>())
87 std::vector<T> input = armnnUtils::QuantizedVector<T>(
96 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
103 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
104 descriptor, inputTensorInfo,
105 outputTensorInfo, input, outputExpected);
108 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
117 unsigned int inputShape[] = { 1, 2, 2, 3 };
118 unsigned int outputShape[] = { 1, 3, 2, 2 };
129 if(armnn::IsQuantizedType<T>())
137 std::vector<T> input = armnnUtils::QuantizedVector<T>(
146 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
154 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
155 descriptor, inputTensorInfo,
156 outputTensorInfo, input, outputExpected);
159 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
168 unsigned int inputShape[] = { 1, 3, 2, 2 };
169 unsigned int outputShape[] = { 1, 2, 2, 3 };
180 if(armnn::IsQuantizedType<T>())
188 std::vector<T> input = armnnUtils::QuantizedVector<T>(
196 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
205 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
206 descriptor, inputTensorInfo,
207 outputTensorInfo, input, outputExpected);
210 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
219 unsigned int inputShape[] = { 1, 2, 3, 3 };
220 unsigned int outputShape[] = { 1, 3, 2, 3 };
231 if(armnn::IsQuantizedType<T>())
239 std::vector<T> input = armnnUtils::QuantizedVector<T>(
250 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
252 1, 11, 21, 31, 41, 51,
253 2, 12, 22, 32, 42, 52,
254 3, 13, 23, 33, 43, 53
258 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
259 descriptor, inputTensorInfo,
260 outputTensorInfo, input, outputExpected);
LayerTestResult< T, 4 > SimplePermuteTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
LayerTestResult< T, 4 > PermuteValueSet2Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
LayerTestResult< T, 4 > SimplePermuteTestImpl(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, armnn::PermuteDescriptor descriptor, armnn::TensorInfo inputTensorInfo, armnn::TensorInfo outputTensorInfo, const std::vector< T > &inputData, const std::vector< T > &outputExpectedData)
void IgnoreUnused(Ts &&...)
LayerDescriptor m_Parameters
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.
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
LayerTestResult< T, 4 > PermuteValueSet1Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void SetQuantizationScale(float scale)
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
virtual std::unique_ptr< IWorkload > CreatePermute(const PermuteQueueDescriptor &descriptor, const WorkloadInfo &info) const
Contains information about inputs and outputs to a layer.
void SetQuantizationOffset(int32_t offset)
LayerTestResult< T, 4 > PermuteValueSet3Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
A PermuteDescriptor for the PermuteLayer.
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)