telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | fbf0e5b | 2020-08-17 01:01:06 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 5 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 6 | #pragma once |
| 7 | |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 8 | #include <ResolveType.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 9 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 10 | |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 11 | #include <armnn/backends/IBackendInternal.hpp> |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 12 | #include <armnn/backends/WorkloadFactory.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 13 | |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 14 | #include <armnnTestUtils/WorkloadTestUtils.hpp> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 15 | |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 16 | #include <TensorHelpers.hpp> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 17 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 18 | template<typename T> |
| 19 | LayerTestResult<T, 4> SimplePermuteTestImpl( |
| 20 | armnn::IWorkloadFactory& workloadFactory, |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 21 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 22 | const armnn::ITensorHandleFactory& tensorHandleFactory, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | armnn::PermuteDescriptor descriptor, |
| 24 | armnn::TensorInfo inputTensorInfo, |
| 25 | armnn::TensorInfo outputTensorInfo, |
| 26 | const std::vector<T>& inputData, |
| 27 | const std::vector<T>& outputExpectedData) |
| 28 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 29 | IgnoreUnused(memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 30 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 31 | std::vector<T> actualOutput(outputTensorInfo.GetNumElements()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 32 | |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 33 | std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); |
| 34 | std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 35 | |
| 36 | armnn::PermuteQueueDescriptor data; |
| 37 | data.m_Parameters = descriptor; |
| 38 | armnn::WorkloadInfo info; |
| 39 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 40 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 41 | |
| 42 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreatePermute(data, info); |
| 43 | |
| 44 | inputHandle->Allocate(); |
| 45 | outputHandle->Allocate(); |
| 46 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 47 | CopyDataToITensorHandle(inputHandle.get(), inputData.data()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 48 | |
| 49 | workload->Execute(); |
| 50 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 51 | CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 52 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 53 | return LayerTestResult<T, 4>(actualOutput, |
| 54 | outputExpectedData, |
| 55 | outputHandle->GetShape(), |
| 56 | outputTensorInfo.GetShape()); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 59 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 60 | LayerTestResult<T, 4> SimplePermuteTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 61 | armnn::IWorkloadFactory& workloadFactory, |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 62 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 63 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 64 | { |
| 65 | armnn::TensorInfo inputTensorInfo; |
| 66 | armnn::TensorInfo outputTensorInfo; |
| 67 | |
| 68 | unsigned int inputShape[] = { 1, 2, 2, 2 }; |
| 69 | unsigned int outputShape[] = { 1, 2, 2, 2 }; |
| 70 | |
| 71 | armnn::PermuteDescriptor descriptor; |
| 72 | descriptor.m_DimMappings = {0U, 3U, 1U, 2U}; |
| 73 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 74 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 75 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 77 | // Set quantization parameters if the requested type is a quantized type. |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 78 | float qScale = 0.5f; |
| 79 | int32_t qOffset = 5; |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 80 | if(armnn::IsQuantizedType<T>()) |
| 81 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 82 | inputTensorInfo.SetQuantizationScale(qScale); |
| 83 | inputTensorInfo.SetQuantizationOffset(qOffset); |
| 84 | outputTensorInfo.SetQuantizationScale(qScale); |
| 85 | outputTensorInfo.SetQuantizationOffset(qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 86 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 87 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 88 | std::vector<T> input = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 89 | { |
| 90 | 1, 2, |
| 91 | 3, 4, |
| 92 | 5, 6, |
| 93 | 7, 8 |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 94 | }, |
| 95 | qScale, qOffset); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 96 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 97 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 98 | { |
| 99 | 1, 5, 2, 6, |
| 100 | 3, 7, 4, 8 |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 101 | }, |
| 102 | qScale, qOffset); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 103 | |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 104 | return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory, |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 105 | descriptor, inputTensorInfo, |
| 106 | outputTensorInfo, input, outputExpected); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 107 | } |
| 108 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 109 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 110 | LayerTestResult<T, 4> PermuteValueSet1Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 111 | armnn::IWorkloadFactory& workloadFactory, |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 112 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 113 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 114 | { |
| 115 | armnn::TensorInfo inputTensorInfo; |
| 116 | armnn::TensorInfo outputTensorInfo; |
| 117 | |
| 118 | unsigned int inputShape[] = { 1, 2, 2, 3 }; |
| 119 | unsigned int outputShape[] = { 1, 3, 2, 2 }; |
| 120 | |
| 121 | armnn::PermuteDescriptor descriptor; |
| 122 | descriptor.m_DimMappings = {0U, 2U, 3U, 1U}; |
| 123 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 124 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 125 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 126 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 127 | // Set quantization parameters if the requested type is a quantized type. |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 128 | float qScale = 0.5f; |
| 129 | int32_t qOffset = 5; |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 130 | if(armnn::IsQuantizedType<T>()) |
| 131 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 132 | inputTensorInfo.SetQuantizationScale(qScale); |
| 133 | inputTensorInfo.SetQuantizationOffset(qOffset); |
| 134 | outputTensorInfo.SetQuantizationScale(qScale); |
| 135 | outputTensorInfo.SetQuantizationOffset(qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 136 | } |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 137 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 138 | std::vector<T> input = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 139 | { |
| 140 | 1, 2, 3, |
| 141 | 11, 12, 13, |
| 142 | 21, 22, 23, |
| 143 | 31, 32, 33 |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 144 | }, |
| 145 | qScale, qOffset); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 146 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 147 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 148 | { |
| 149 | 1, 11, 21, 31, |
| 150 | 2, 12, 22, 32, |
| 151 | 3, 13, 23, 33 |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 152 | }, |
| 153 | qScale, qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 154 | |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 155 | return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory, |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 156 | descriptor, inputTensorInfo, |
| 157 | outputTensorInfo, input, outputExpected); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 158 | } |
| 159 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 160 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 161 | LayerTestResult<T, 4> PermuteValueSet2Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 162 | armnn::IWorkloadFactory& workloadFactory, |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 163 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 164 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 165 | { |
| 166 | armnn::TensorInfo inputTensorInfo; |
| 167 | armnn::TensorInfo outputTensorInfo; |
| 168 | |
| 169 | unsigned int inputShape[] = { 1, 3, 2, 2 }; |
| 170 | unsigned int outputShape[] = { 1, 2, 2, 3 }; |
| 171 | |
| 172 | armnn::PermuteDescriptor descriptor; |
| 173 | descriptor.m_DimMappings = {0U, 3U, 1U, 2U}; |
| 174 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 175 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 176 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 177 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 178 | // Set quantization parameters if the requested type is a quantized type. |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 179 | float qScale = 0.5f; |
| 180 | int32_t qOffset = 5; |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 181 | if(armnn::IsQuantizedType<T>()) |
| 182 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 183 | inputTensorInfo.SetQuantizationScale(qScale); |
| 184 | inputTensorInfo.SetQuantizationOffset(qOffset); |
| 185 | outputTensorInfo.SetQuantizationScale(qScale); |
| 186 | outputTensorInfo.SetQuantizationOffset(qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 187 | } |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 188 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 189 | std::vector<T> input = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 190 | { |
| 191 | 1, 11, 21, 31, |
| 192 | 2, 12, 22, 32, |
| 193 | 3, 13, 23, 33 |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 194 | }, |
| 195 | qScale, qOffset); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 196 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 197 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>( |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 198 | { |
| 199 | 1, 2, 3, |
| 200 | 11, 12, 13, |
| 201 | 21, 22, 23, |
| 202 | 31, 32, 33, |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 203 | }, |
| 204 | qScale, qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 205 | |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 206 | return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory, |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 207 | descriptor, inputTensorInfo, |
| 208 | outputTensorInfo, input, outputExpected); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 209 | } |
| 210 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 211 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 212 | LayerTestResult<T, 4> PermuteValueSet3Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 213 | armnn::IWorkloadFactory& workloadFactory, |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 214 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 215 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 216 | { |
| 217 | armnn::TensorInfo inputTensorInfo; |
| 218 | armnn::TensorInfo outputTensorInfo; |
| 219 | |
| 220 | unsigned int inputShape[] = { 1, 2, 3, 3 }; |
| 221 | unsigned int outputShape[] = { 1, 3, 2, 3 }; |
| 222 | |
| 223 | armnn::PermuteDescriptor descriptor; |
| 224 | descriptor.m_DimMappings = {0U, 2U, 3U, 1U}; |
| 225 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 226 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 227 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 228 | |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 229 | // Set quantization parameters if the requested type is a quantized type. |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 230 | float qScale = 0.5f; |
| 231 | int32_t qOffset = 5; |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 232 | if(armnn::IsQuantizedType<T>()) |
| 233 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 234 | inputTensorInfo.SetQuantizationScale(qScale); |
| 235 | inputTensorInfo.SetQuantizationOffset(qOffset); |
| 236 | outputTensorInfo.SetQuantizationScale(qScale); |
| 237 | outputTensorInfo.SetQuantizationOffset(qOffset); |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 238 | } |
| 239 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 240 | std::vector<T> input = armnnUtils::QuantizedVector<T>( |
| 241 | { |
| 242 | 1, 2, 3, |
| 243 | 11, 12, 13, |
| 244 | 21, 22, 23, |
| 245 | 31, 32, 33, |
| 246 | 41, 42, 43, |
| 247 | 51, 52, 53 |
| 248 | }, |
| 249 | qScale, qOffset); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 250 | |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 251 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>( |
| 252 | { |
| 253 | 1, 11, 21, 31, 41, 51, |
| 254 | 2, 12, 22, 32, 42, 52, |
| 255 | 3, 13, 23, 33, 43, 53 |
| 256 | }, |
| 257 | qScale, qOffset); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 258 | |
Finn Williams | 826a543 | 2020-08-27 16:15:20 +0100 | [diff] [blame] | 259 | return SimplePermuteTestImpl<T>(workloadFactory, memoryManager, tensorHandleFactory, |
Narumol Prangnawarat | 86bb4e1 | 2019-07-08 11:36:05 +0100 | [diff] [blame] | 260 | descriptor, inputTensorInfo, |
| 261 | outputTensorInfo, input, outputExpected); |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 262 | } |