27 const std::vector<T>& inputData,
28 const std::vector<T>& outputExpectedData)
33 std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.
CreateTensorHandle(inputTensorInfo);
34 std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.
CreateTensorHandle(outputTensorInfo);
39 AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
40 AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
46 inputHandle->Allocate();
47 outputHandle->Allocate();
57 outputHandle->GetShape(),
61 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
70 unsigned int inputShape[] = { 1, 2, 2, 2 };
71 unsigned int outputShape[] = { 1, 2, 2, 2 };
82 if(armnn::IsQuantizedType<T>())
90 std::vector<T> input = armnnUtils::QuantizedVector<T>(
99 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
107 descriptor, inputTensorInfo,
108 outputTensorInfo, input, outputExpected);
111 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
120 unsigned int inputShape[] = { 1, 2, 2, 3 };
121 unsigned int outputShape[] = { 1, 3, 2, 2 };
132 if(armnn::IsQuantizedType<T>())
140 std::vector<T> input = armnnUtils::QuantizedVector<T>(
149 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
157 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
158 descriptor, inputTensorInfo,
159 outputTensorInfo, input, outputExpected);
162 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
171 unsigned int inputShape[] = { 1, 3, 2, 2 };
172 unsigned int outputShape[] = { 1, 2, 2, 3 };
183 if(armnn::IsQuantizedType<T>())
191 std::vector<T> input = armnnUtils::QuantizedVector<T>(
199 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
208 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
209 descriptor, inputTensorInfo,
210 outputTensorInfo, input, outputExpected);
213 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
222 unsigned int inputShape[] = { 1, 2, 3, 3 };
223 unsigned int outputShape[] = { 1, 3, 2, 3 };
234 if(armnn::IsQuantizedType<T>())
242 std::vector<T> input = armnnUtils::QuantizedVector<T>(
253 std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>(
255 1, 11, 21, 31, 41, 51,
256 2, 12, 22, 32, 42, 52,
257 3, 13, 23, 33, 43, 53
261 return SimpleTransposeTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory,
262 descriptor, inputTensorInfo,
263 outputTensorInfo, input, outputExpected);
LayerTestResult< T, 4 > SimpleTransposeTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
const TensorShape & GetShape() const
LayerTestResult< T, 4 > TransposeValueSet2Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
void IgnoreUnused(Ts &&...)
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 CopyDataFromITensorHandle(void *mem, const armnn::ITensorHandle *tensorHandle)
void SetQuantizationScale(float scale)
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)
LayerTestResult< T, 4 > TransposeValueSet3Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
A TransposeDescriptor for the TransposeLayer.
Contains information about TensorInfos of 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< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const
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.
unsigned int GetNumElements() const