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);
35 std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.
CreateTensorHandle(inputTensorInfo);
36 std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.
CreateTensorHandle(outputTensorInfo);
42 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
43 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
45 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.
CreatePermute(data, info);
47 inputHandle->Allocate();
48 outputHandle->Allocate();
59 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,
104 descriptor, inputTensorInfo,
105 outputTensorInfo, input, outputExpected);
108 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
116 unsigned int inputShape[] = { 1, 2, 2, 3 };
117 unsigned int outputShape[] = { 1, 3, 2, 2 };
128 if(armnn::IsQuantizedType<T>())
136 std::vector<T> input = armnnUtils::QuantizedVector<T>(
145 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
153 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager,
154 descriptor, inputTensorInfo,
155 outputTensorInfo, input, outputExpected);
158 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
166 unsigned int inputShape[] = { 1, 3, 2, 2 };
167 unsigned int outputShape[] = { 1, 2, 2, 3 };
178 if(armnn::IsQuantizedType<T>())
186 std::vector<T> input = armnnUtils::QuantizedVector<T>(
194 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
203 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager,
204 descriptor, inputTensorInfo,
205 outputTensorInfo, input, outputExpected);
208 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
216 unsigned int inputShape[] = { 1, 2, 3, 3 };
217 unsigned int outputShape[] = { 1, 3, 2, 3 };
228 if(armnn::IsQuantizedType<T>())
236 std::vector<T> input = armnnUtils::QuantizedVector<T>(
247 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
249 1, 11, 21, 31, 41, 51,
250 2, 12, 22, 32, 42, 52,
251 3, 13, 23, 33, 43, 53
255 return SimplePermuteTestImpl<T>(workloadFactory, memoryManager,
256 descriptor, inputTensorInfo,
257 outputTensorInfo, input, outputExpected);
LayerTestResult< T, 4 > PermuteValueSet3Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
LayerTestResult< T, 4 > SimplePermuteTestImpl(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, armnn::PermuteDescriptor descriptor, armnn::TensorInfo inputTensorInfo, armnn::TensorInfo outputTensorInfo, const std::vector< T > &inputData, const std::vector< T > &outputExpectedData)
LayerTestResult< T, 4 > PermuteValueSet1Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
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.
LayerTestResult< T, 4 > SimplePermuteTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
#define ARMNN_NO_DEPRECATE_WARN_END
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
virtual std::unique_ptr< IWorkload > CreatePermute(const PermuteQueueDescriptor &descriptor, const WorkloadInfo &info) const
LayerTestResult< T, 4 > PermuteValueSet2Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
Contains information about inputs and outputs to a layer.
void SetQuantizationOffset(int32_t offset)
A PermuteDescriptor for the PermuteLayer.
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)