Tianle Cheng | 988354d | 2023-06-28 13:20:47 +0100 | [diff] [blame^] | 1 | // |
| 2 | // Copyright © 2023 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "ReverseV2TestImpl.hpp" |
| 7 | |
| 8 | #include <armnn/backends/IBackendInternal.hpp> |
| 9 | #include <armnn/backends/Workload.hpp> |
| 10 | #include <armnn/backends/WorkloadData.hpp> |
| 11 | #include <armnn/backends/WorkloadFactory.hpp> |
| 12 | |
| 13 | #include <armnnTestUtils/WorkloadTestUtils.hpp> |
| 14 | #include <armnnUtils/QuantizeHelper.hpp> |
| 15 | #include <armnnTestUtils/TensorCopyUtils.hpp> |
| 16 | #include <armnn/Optional.hpp> |
| 17 | #include <armnn/BackendHelper.hpp> |
| 18 | |
| 19 | namespace |
| 20 | { |
| 21 | template<armnn::DataType ArmnnType, typename T, std::size_t NumDims> |
| 22 | LayerTestResult<T, NumDims> ReverseV2TestImpl( |
| 23 | armnn::IWorkloadFactory& workloadFactory, |
| 24 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 25 | const armnn::ITensorHandleFactory& tensorHandleFactory, |
| 26 | armnn::ReverseV2Descriptor descriptor, |
| 27 | const std::vector<T>& input, |
| 28 | const std::vector<T>& outputExpected, |
| 29 | const armnn::TensorInfo& inputInfo, |
| 30 | const armnn::TensorInfo& outputInfo) |
| 31 | { |
| 32 | LayerTestResult<T, NumDims> result(outputInfo); |
| 33 | std::vector<T> outputActual(outputInfo.GetNumElements()); |
| 34 | |
| 35 | std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.CreateTensorHandle(inputInfo); |
| 36 | std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.CreateTensorHandle(outputInfo); |
| 37 | |
| 38 | armnn::ReverseV2QueueDescriptor queueDescriptor; |
| 39 | queueDescriptor.m_Parameters = std::move(descriptor); |
| 40 | armnn::WorkloadInfo workloadInfo; |
| 41 | |
| 42 | AddInputToWorkload(queueDescriptor, workloadInfo, inputInfo, inputHandle.get()); |
| 43 | AddOutputToWorkload(queueDescriptor, workloadInfo, outputInfo, outputHandle.get()); |
| 44 | |
| 45 | // Don't execute if ReverseV2 is not supported, as an exception will be raised. |
| 46 | const armnn::BackendId& backend = workloadFactory.GetBackendId(); |
| 47 | std::string reasonIfUnsupported; |
| 48 | armnn::LayerSupportHandle handle = armnn::GetILayerSupportByBackendId(backend); |
| 49 | result.m_Supported = handle.IsReverseV2Supported(inputInfo, |
| 50 | outputInfo, |
| 51 | queueDescriptor.m_Parameters, |
| 52 | reasonIfUnsupported); |
| 53 | if (!result.m_Supported) |
| 54 | { |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | auto workload = workloadFactory.CreateWorkload(armnn::LayerType::ReverseV2, queueDescriptor, workloadInfo); |
| 59 | |
| 60 | inputHandle->Allocate(); |
| 61 | outputHandle->Allocate(); |
| 62 | |
| 63 | CopyDataToITensorHandle(inputHandle.get(), input.data()); |
| 64 | |
| 65 | workload->PostAllocationConfigure(); |
| 66 | ExecuteWorkload(*workload, memoryManager); |
| 67 | |
| 68 | CopyDataFromITensorHandle(outputActual.data(), outputHandle.get()); |
| 69 | |
| 70 | return LayerTestResult<T, NumDims>(outputActual, |
| 71 | outputExpected, |
| 72 | outputHandle->GetShape(), |
| 73 | outputInfo.GetShape()); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | template<armnn::DataType ArmnnType, typename T> |
| 78 | LayerTestResult<T, 2> ReverseV2SimpleTestEmptyAxis( |
| 79 | armnn::IWorkloadFactory& workloadFactory, |
| 80 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 81 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 82 | { |
| 83 | // Simple test with default descriptor. No axes set so output is the same as input |
| 84 | auto descriptor = armnn::ReverseV2Descriptor(); |
| 85 | |
| 86 | float qScale = 1.0f; |
| 87 | int32_t qOffset = 0; |
| 88 | |
| 89 | armnn::TensorInfo inputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 90 | armnn::TensorInfo outputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 91 | |
| 92 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 93 | 1, 2, |
| 94 | 3, 4 |
| 95 | }, qScale, qOffset); |
| 96 | |
| 97 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 98 | 1, 2, |
| 99 | 3, 4 |
| 100 | }, qScale, qOffset); |
| 101 | |
| 102 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 103 | memoryManager, |
| 104 | tensorHandleFactory, |
| 105 | descriptor, |
| 106 | input, |
| 107 | outputExpected, |
| 108 | inputInfo, |
| 109 | outputInfo); |
| 110 | } |
| 111 | |
| 112 | template<armnn::DataType ArmnnType, typename T> |
| 113 | LayerTestResult<T, 2> ReverseV2SimpleTestEmptyTensor( |
| 114 | armnn::IWorkloadFactory& workloadFactory, |
| 115 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 116 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 117 | { |
| 118 | // Simple test with default descriptor. Empty tensor set so output is the same as input |
| 119 | auto descriptor = armnn::ReverseV2Descriptor(); |
| 120 | |
| 121 | float qScale = 1.0f; |
| 122 | int32_t qOffset = 0; |
| 123 | |
| 124 | armnn::TensorInfo inputInfo({0}, ArmnnType, qScale, qOffset); |
| 125 | armnn::TensorInfo outputInfo({0}, ArmnnType, qScale, qOffset); |
| 126 | |
| 127 | std::vector<T> input = armnnUtils::QuantizedVector<T>({}, qScale, qOffset); |
| 128 | |
| 129 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({}, qScale, qOffset); |
| 130 | |
| 131 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 132 | memoryManager, |
| 133 | tensorHandleFactory, |
| 134 | descriptor, |
| 135 | input, |
| 136 | outputExpected, |
| 137 | inputInfo, |
| 138 | outputInfo); |
| 139 | } |
| 140 | |
| 141 | template<armnn::DataType ArmnnType, typename T> |
| 142 | LayerTestResult<T, 2> ReverseV2SimpleTest1Dim( |
| 143 | armnn::IWorkloadFactory& workloadFactory, |
| 144 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 145 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 146 | { |
| 147 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0}); |
| 148 | |
| 149 | float qScale = 1.0f; |
| 150 | int32_t qOffset = 0; |
| 151 | |
| 152 | armnn::TensorInfo inputInfo({4}, ArmnnType, qScale, qOffset); |
| 153 | armnn::TensorInfo outputInfo({4}, ArmnnType, qScale, qOffset); |
| 154 | |
| 155 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 156 | 1, 2, |
| 157 | 3, 4 |
| 158 | }, qScale, qOffset); |
| 159 | |
| 160 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 161 | 4, 3, |
| 162 | 2, 1 |
| 163 | }, qScale, qOffset); |
| 164 | |
| 165 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 166 | memoryManager, |
| 167 | tensorHandleFactory, |
| 168 | descriptor, |
| 169 | input, |
| 170 | outputExpected, |
| 171 | inputInfo, |
| 172 | outputInfo); |
| 173 | } |
| 174 | |
| 175 | template<armnn::DataType ArmnnType, typename T> |
| 176 | LayerTestResult<T, 2> ReverseV2SimpleTest2Dim1Axis( |
| 177 | armnn::IWorkloadFactory& workloadFactory, |
| 178 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 179 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 180 | { |
| 181 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 182 | |
| 183 | float qScale = 1.0f; |
| 184 | int32_t qOffset = 0; |
| 185 | |
| 186 | armnn::TensorInfo inputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 187 | armnn::TensorInfo outputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 188 | |
| 189 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 190 | 1, 2, |
| 191 | 3, 4 |
| 192 | }, qScale, qOffset); |
| 193 | |
| 194 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 195 | 2, 1, |
| 196 | 4, 3 |
| 197 | }, qScale, qOffset); |
| 198 | |
| 199 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 200 | memoryManager, |
| 201 | tensorHandleFactory, |
| 202 | descriptor, |
| 203 | input, |
| 204 | outputExpected, |
| 205 | inputInfo, |
| 206 | outputInfo); |
| 207 | } |
| 208 | |
| 209 | template<armnn::DataType ArmnnType, typename T> |
| 210 | LayerTestResult<T, 2> ReverseV2SimpleTest2Dim2Axis( |
| 211 | armnn::IWorkloadFactory& workloadFactory, |
| 212 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 213 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 214 | { |
| 215 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1, 0}); |
| 216 | |
| 217 | float qScale = 1.0f; |
| 218 | int32_t qOffset = 0; |
| 219 | |
| 220 | armnn::TensorInfo inputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 221 | armnn::TensorInfo outputInfo({2,2}, ArmnnType, qScale, qOffset); |
| 222 | |
| 223 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 224 | 1, 2, |
| 225 | 3, 4 |
| 226 | }, qScale, qOffset); |
| 227 | |
| 228 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 229 | 4, 3, |
| 230 | 2, 1 |
| 231 | }, qScale, qOffset); |
| 232 | |
| 233 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 234 | memoryManager, |
| 235 | tensorHandleFactory, |
| 236 | descriptor, |
| 237 | input, |
| 238 | outputExpected, |
| 239 | inputInfo, |
| 240 | outputInfo); |
| 241 | } |
| 242 | |
| 243 | template<armnn::DataType ArmnnType, typename T> |
| 244 | LayerTestResult<T, 2> ReverseV2SimpleTest3Dim1Axis( |
| 245 | armnn::IWorkloadFactory& workloadFactory, |
| 246 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 247 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 248 | { |
| 249 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 250 | |
| 251 | float qScale = 1.0f; |
| 252 | int32_t qOffset = 0; |
| 253 | |
| 254 | armnn::TensorInfo inputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 255 | armnn::TensorInfo outputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 256 | |
| 257 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 258 | 1, 2, 3, 4, |
| 259 | 5, 6, 7, 8, |
| 260 | 9, 10, 11, 12, |
| 261 | 13, 14, 15, 16, |
| 262 | 17, 18, 19, 20, |
| 263 | 21, 22, 23, 24 |
| 264 | }, qScale, qOffset); |
| 265 | |
| 266 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 267 | 9, 10, 11, 12, |
| 268 | 5, 6, 7, 8, |
| 269 | 1, 2, 3, 4, |
| 270 | 21, 22, 23, 24, |
| 271 | 17, 18, 19, 20, |
| 272 | 13, 14, 15, 16 |
| 273 | }, qScale, qOffset); |
| 274 | |
| 275 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 276 | memoryManager, |
| 277 | tensorHandleFactory, |
| 278 | descriptor, |
| 279 | input, |
| 280 | outputExpected, |
| 281 | inputInfo, |
| 282 | outputInfo); |
| 283 | } |
| 284 | |
| 285 | template<armnn::DataType ArmnnType, typename T> |
| 286 | LayerTestResult<T, 2> ReverseV2SimpleTest3Dim2Axis( |
| 287 | armnn::IWorkloadFactory& workloadFactory, |
| 288 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 289 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 290 | { |
| 291 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0, 1}); |
| 292 | |
| 293 | float qScale = 1.0f; |
| 294 | int32_t qOffset = 0; |
| 295 | |
| 296 | armnn::TensorInfo inputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 297 | armnn::TensorInfo outputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 298 | |
| 299 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 300 | 1, 2, 3, 4, |
| 301 | 5, 6, 7, 8, |
| 302 | 9, 10, 11, 12, |
| 303 | 13, 14, 15, 16, |
| 304 | 17, 18, 19, 20, |
| 305 | 21, 22, 23, 24 |
| 306 | }, qScale, qOffset); |
| 307 | |
| 308 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 309 | 21, 22, 23, 24, |
| 310 | 17, 18, 19, 20, |
| 311 | 13, 14, 15, 16, |
| 312 | 9, 10, 11, 12, |
| 313 | 5, 6, 7, 8, |
| 314 | 1, 2, 3, 4 |
| 315 | }, qScale, qOffset); |
| 316 | |
| 317 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 318 | memoryManager, |
| 319 | tensorHandleFactory, |
| 320 | descriptor, |
| 321 | input, |
| 322 | outputExpected, |
| 323 | inputInfo, |
| 324 | outputInfo); |
| 325 | } |
| 326 | |
| 327 | template<armnn::DataType ArmnnType, typename T> |
| 328 | LayerTestResult<T, 2> ReverseV2SimpleTest3Dim3Axis( |
| 329 | armnn::IWorkloadFactory& workloadFactory, |
| 330 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 331 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 332 | { |
| 333 | // Simple test with default descriptor. No axes set so output is |
| 334 | // the same as input |
| 335 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1, 0, 2}); |
| 336 | |
| 337 | float qScale = 1.0f; |
| 338 | int32_t qOffset = 0; |
| 339 | |
| 340 | armnn::TensorInfo inputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 341 | armnn::TensorInfo outputInfo({2, 3, 4}, ArmnnType, qScale, qOffset); |
| 342 | |
| 343 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 344 | 1, 2, 3, 4, |
| 345 | 5, 6, 7, 8, |
| 346 | 9, 10, 11, 12, |
| 347 | 13, 14, 15, 16, |
| 348 | 17, 18, 19, 20, |
| 349 | 21, 22, 23, 24 |
| 350 | }, qScale, qOffset); |
| 351 | |
| 352 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 353 | 24, 23, 22, 21, |
| 354 | 20, 19, 18, 17, |
| 355 | 16, 15, 14, 13, |
| 356 | 12, 11, 10, 9, |
| 357 | 8, 7, 6, 5, |
| 358 | 4, 3, 2, 1 |
| 359 | }, qScale, qOffset); |
| 360 | |
| 361 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 362 | memoryManager, |
| 363 | tensorHandleFactory, |
| 364 | descriptor, |
| 365 | input, |
| 366 | outputExpected, |
| 367 | inputInfo, |
| 368 | outputInfo); |
| 369 | } |
| 370 | |
| 371 | template<armnn::DataType ArmnnType, typename T> |
| 372 | LayerTestResult<T, 2> ReverseV2SimpleTest4Dim1Axis( |
| 373 | armnn::IWorkloadFactory& workloadFactory, |
| 374 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 375 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 376 | { |
| 377 | // Simple test with default descriptor. No axes set so output is |
| 378 | // the same as input |
| 379 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0}); |
| 380 | |
| 381 | float qScale = 1.0f; |
| 382 | int32_t qOffset = 0; |
| 383 | |
| 384 | armnn::TensorInfo inputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 385 | armnn::TensorInfo outputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 386 | |
| 387 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 388 | 1, 2, 3, |
| 389 | 4, 5, 6, |
| 390 | 7, 8, 9, |
| 391 | 10, 11, 12, |
| 392 | 13, 14, 15, |
| 393 | 16, 17, 18, |
| 394 | 19, 20, 21, |
| 395 | 22, 23, 24 |
| 396 | }, qScale, qOffset); |
| 397 | |
| 398 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 399 | 13, 14, 15, |
| 400 | 16, 17, 18, |
| 401 | 19, 20, 21, |
| 402 | 22, 23, 24, |
| 403 | 1, 2, 3, |
| 404 | 4, 5, 6, |
| 405 | 7, 8, 9, |
| 406 | 10, 11, 12 |
| 407 | }, qScale, qOffset); |
| 408 | |
| 409 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 410 | memoryManager, |
| 411 | tensorHandleFactory, |
| 412 | descriptor, |
| 413 | input, |
| 414 | outputExpected, |
| 415 | inputInfo, |
| 416 | outputInfo); |
| 417 | } |
| 418 | |
| 419 | template<armnn::DataType ArmnnType, typename T> |
| 420 | LayerTestResult<T, 2> ReverseV2SimpleTest4Dim2Axis( |
| 421 | armnn::IWorkloadFactory& workloadFactory, |
| 422 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 423 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 424 | { |
| 425 | // Simple test with default descriptor. No axes set so output is |
| 426 | // the same as input |
| 427 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0, 1}); |
| 428 | |
| 429 | float qScale = 1.0f; |
| 430 | int32_t qOffset = 0; |
| 431 | |
| 432 | armnn::TensorInfo inputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 433 | armnn::TensorInfo outputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 434 | |
| 435 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 436 | 1, 2, 3, |
| 437 | 4, 5, 6, |
| 438 | 7, 8, 9, |
| 439 | 10, 11, 12, |
| 440 | 13, 14, 15, |
| 441 | 16, 17, 18, |
| 442 | 19, 20, 21, |
| 443 | 22, 23, 24 |
| 444 | }, qScale, qOffset); |
| 445 | |
| 446 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 447 | 19, 20, 21, |
| 448 | 22, 23, 24, |
| 449 | 13, 14, 15, |
| 450 | 16, 17, 18, |
| 451 | 7, 8, 9, |
| 452 | 10, 11, 12, |
| 453 | 1, 2, 3, |
| 454 | 4, 5, 6 |
| 455 | }, qScale, qOffset); |
| 456 | |
| 457 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 458 | memoryManager, |
| 459 | tensorHandleFactory, |
| 460 | descriptor, |
| 461 | input, |
| 462 | outputExpected, |
| 463 | inputInfo, |
| 464 | outputInfo); |
| 465 | } |
| 466 | |
| 467 | template<armnn::DataType ArmnnType, typename T> |
| 468 | LayerTestResult<T, 2> ReverseV2SimpleTest4Dim3Axis( |
| 469 | armnn::IWorkloadFactory& workloadFactory, |
| 470 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 471 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 472 | { |
| 473 | // Simple test with default descriptor. No axes set so output is |
| 474 | // the same as input |
| 475 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0, 1, 2}); |
| 476 | |
| 477 | float qScale = 1.0f; |
| 478 | int32_t qOffset = 0; |
| 479 | |
| 480 | armnn::TensorInfo inputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 481 | armnn::TensorInfo outputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 482 | |
| 483 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 484 | 1, 2, 3, |
| 485 | 4, 5, 6, |
| 486 | 7, 8, 9, |
| 487 | 10, 11, 12, |
| 488 | 13, 14, 15, |
| 489 | 16, 17, 18, |
| 490 | 19, 20, 21, |
| 491 | 22, 23, 24 |
| 492 | }, qScale, qOffset); |
| 493 | |
| 494 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 495 | 22, 23, 24, |
| 496 | 19, 20, 21, |
| 497 | 16, 17, 18, |
| 498 | 13, 14, 15, |
| 499 | 10, 11, 12, |
| 500 | 7, 8, 9, |
| 501 | 4, 5, 6, |
| 502 | 1, 2, 3 |
| 503 | }, qScale, qOffset); |
| 504 | |
| 505 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 506 | memoryManager, |
| 507 | tensorHandleFactory, |
| 508 | descriptor, |
| 509 | input, |
| 510 | outputExpected, |
| 511 | inputInfo, |
| 512 | outputInfo); |
| 513 | } |
| 514 | |
| 515 | template<armnn::DataType ArmnnType, typename T> |
| 516 | LayerTestResult<T, 2> ReverseV2SimpleTest4Dim4Axis( |
| 517 | armnn::IWorkloadFactory& workloadFactory, |
| 518 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 519 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 520 | { |
| 521 | // Simple test with default descriptor. No axes set so output is |
| 522 | // the same as input |
| 523 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {0, 1, 2, 3}); |
| 524 | |
| 525 | float qScale = 1.0f; |
| 526 | int32_t qOffset = 0; |
| 527 | |
| 528 | armnn::TensorInfo inputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 529 | armnn::TensorInfo outputInfo({2, 2, 2, 3}, ArmnnType, qScale, qOffset); |
| 530 | |
| 531 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 532 | 1, 2, 3, |
| 533 | 4, 5, 6, |
| 534 | 7, 8, 9, |
| 535 | 10, 11, 12, |
| 536 | 13, 14, 15, |
| 537 | 16, 17, 18, |
| 538 | 19, 20, 21, |
| 539 | 22, 23, 24 |
| 540 | }, qScale, qOffset); |
| 541 | |
| 542 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 543 | 24, 23, 22, |
| 544 | 21, 20, 19, |
| 545 | 18, 17, 16, |
| 546 | 15, 14, 13, |
| 547 | 12, 11, 10, |
| 548 | 9, 8, 7, |
| 549 | 6, 5, 4, |
| 550 | 3, 2, 1 |
| 551 | }, qScale, qOffset); |
| 552 | |
| 553 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 554 | memoryManager, |
| 555 | tensorHandleFactory, |
| 556 | descriptor, |
| 557 | input, |
| 558 | outputExpected, |
| 559 | inputInfo, |
| 560 | outputInfo); |
| 561 | } |
| 562 | |
| 563 | template<armnn::DataType ArmnnType, typename T> |
| 564 | LayerTestResult<T, 2> ReverseV2EvenRowOddColTest2Dim( |
| 565 | armnn::IWorkloadFactory& workloadFactory, |
| 566 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 567 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 568 | { |
| 569 | // Simple test with default descriptor. No axes set so output is the same as input |
| 570 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 571 | |
| 572 | float qScale = 1.0f; |
| 573 | int32_t qOffset = 0; |
| 574 | |
| 575 | armnn::TensorInfo inputInfo({2, 3}, ArmnnType, qScale, qOffset); |
| 576 | armnn::TensorInfo outputInfo({2, 3}, ArmnnType, qScale, qOffset); |
| 577 | |
| 578 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 579 | 1, 2, 3, |
| 580 | 4, 5, 6 |
| 581 | }, qScale, qOffset); |
| 582 | |
| 583 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 584 | 3, 2, 1, |
| 585 | 6, 5, 4 |
| 586 | }, qScale, qOffset); |
| 587 | |
| 588 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 589 | memoryManager, |
| 590 | tensorHandleFactory, |
| 591 | descriptor, |
| 592 | input, |
| 593 | outputExpected, |
| 594 | inputInfo, |
| 595 | outputInfo); |
| 596 | } |
| 597 | |
| 598 | template<armnn::DataType ArmnnType, typename T> |
| 599 | LayerTestResult<T, 2> ReverseV2EvenRowOddColTest3Dim( |
| 600 | armnn::IWorkloadFactory& workloadFactory, |
| 601 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 602 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 603 | { |
| 604 | // Simple test with default descriptor. No axes set so output is |
| 605 | // the same as input |
| 606 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 607 | |
| 608 | float qScale = 1.0f; |
| 609 | int32_t qOffset = 0; |
| 610 | |
| 611 | armnn::TensorInfo inputInfo({2, 3, 1}, ArmnnType, qScale, qOffset); |
| 612 | armnn::TensorInfo outputInfo({2, 3, 1}, ArmnnType, qScale, qOffset); |
| 613 | |
| 614 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 615 | 1, 2, 3, |
| 616 | 4, 5, 6 |
| 617 | }, qScale, qOffset); |
| 618 | |
| 619 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 620 | 3, 2, 1, |
| 621 | 6, 5, 4 |
| 622 | }, qScale, qOffset); |
| 623 | |
| 624 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 625 | memoryManager, |
| 626 | tensorHandleFactory, |
| 627 | descriptor, |
| 628 | input, |
| 629 | outputExpected, |
| 630 | inputInfo, |
| 631 | outputInfo); |
| 632 | } |
| 633 | |
| 634 | template<armnn::DataType ArmnnType, typename T> |
| 635 | LayerTestResult<T, 2> ReverseV2EvenRowEvenColTest2Dim( |
| 636 | armnn::IWorkloadFactory& workloadFactory, |
| 637 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 638 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 639 | { |
| 640 | // Simple test with default descriptor. No axes set so output is |
| 641 | // the same as input |
| 642 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 643 | |
| 644 | float qScale = 1.0f; |
| 645 | int32_t qOffset = 0; |
| 646 | |
| 647 | armnn::TensorInfo inputInfo({2, 4}, ArmnnType, qScale, qOffset); |
| 648 | armnn::TensorInfo outputInfo({2, 4}, ArmnnType, qScale, qOffset); |
| 649 | |
| 650 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 651 | 1, 2, 3, 4, |
| 652 | 5, 6, 7, 8 |
| 653 | }, qScale, qOffset); |
| 654 | |
| 655 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 656 | 4, 3, 2, 1, |
| 657 | 8, 7, 6, 5 |
| 658 | }, qScale, qOffset); |
| 659 | |
| 660 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 661 | memoryManager, |
| 662 | tensorHandleFactory, |
| 663 | descriptor, |
| 664 | input, |
| 665 | outputExpected, |
| 666 | inputInfo, |
| 667 | outputInfo); |
| 668 | } |
| 669 | |
| 670 | template<armnn::DataType ArmnnType, typename T> |
| 671 | LayerTestResult<T, 2> ReverseV2EvenRowEvenColTest3Dim( |
| 672 | armnn::IWorkloadFactory& workloadFactory, |
| 673 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 674 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 675 | { |
| 676 | // Simple test with default descriptor. No axes set so output is |
| 677 | // the same as input |
| 678 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 679 | |
| 680 | float qScale = 1.0f; |
| 681 | int32_t qOffset = 0; |
| 682 | |
| 683 | armnn::TensorInfo inputInfo({2, 4, 1}, ArmnnType, qScale, qOffset); |
| 684 | armnn::TensorInfo outputInfo({2, 4, 1}, ArmnnType, qScale, qOffset); |
| 685 | |
| 686 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 687 | 1, 2, 3, 4, |
| 688 | 5, 6, 7, 8 |
| 689 | }, qScale, qOffset); |
| 690 | |
| 691 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 692 | 4, 3, 2, 1, |
| 693 | 8, 7, 6, 5 |
| 694 | }, qScale, qOffset); |
| 695 | |
| 696 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 697 | memoryManager, |
| 698 | tensorHandleFactory, |
| 699 | descriptor, |
| 700 | input, |
| 701 | outputExpected, |
| 702 | inputInfo, |
| 703 | outputInfo); |
| 704 | } |
| 705 | |
| 706 | template<armnn::DataType ArmnnType, typename T> |
| 707 | LayerTestResult<T, 2> ReverseV2OddRowOddColTest2Dim( |
| 708 | armnn::IWorkloadFactory& workloadFactory, |
| 709 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 710 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 711 | { |
| 712 | // Simple test with default descriptor. No axes set so output is |
| 713 | // the same as input |
| 714 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 715 | |
| 716 | float qScale = 1.0f; |
| 717 | int32_t qOffset = 0; |
| 718 | |
| 719 | armnn::TensorInfo inputInfo({3, 3}, ArmnnType, qScale, qOffset); |
| 720 | armnn::TensorInfo outputInfo({3, 3}, ArmnnType, qScale, qOffset); |
| 721 | |
| 722 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 723 | 1, 2, 3, |
| 724 | 4, 5, 6, |
| 725 | 7, 8, 9 |
| 726 | }, qScale, qOffset); |
| 727 | |
| 728 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 729 | 3, 2, 1, |
| 730 | 6, 5, 4, |
| 731 | 9, 8, 7 |
| 732 | }, qScale, qOffset); |
| 733 | |
| 734 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 735 | memoryManager, |
| 736 | tensorHandleFactory, |
| 737 | descriptor, |
| 738 | input, |
| 739 | outputExpected, |
| 740 | inputInfo, |
| 741 | outputInfo); |
| 742 | } |
| 743 | |
| 744 | template<armnn::DataType ArmnnType, typename T> |
| 745 | LayerTestResult<T, 2> ReverseV2OddRowOddColTest3Dim( |
| 746 | armnn::IWorkloadFactory& workloadFactory, |
| 747 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 748 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 749 | { |
| 750 | // Simple test with default descriptor. No axes set so output is |
| 751 | // the same as input |
| 752 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 753 | |
| 754 | float qScale = 1.0f; |
| 755 | int32_t qOffset = 0; |
| 756 | |
| 757 | armnn::TensorInfo inputInfo({3, 3, 1}, ArmnnType, qScale, qOffset); |
| 758 | armnn::TensorInfo outputInfo({3, 3, 1}, ArmnnType, qScale, qOffset); |
| 759 | |
| 760 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 761 | 1, 2, 3, |
| 762 | 4, 5, 6, |
| 763 | 7, 8, 9 |
| 764 | }, qScale, qOffset); |
| 765 | |
| 766 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 767 | 3, 2, 1, |
| 768 | 6, 5, 4, |
| 769 | 9, 8, 7 |
| 770 | }, qScale, qOffset); |
| 771 | |
| 772 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 773 | memoryManager, |
| 774 | tensorHandleFactory, |
| 775 | descriptor, |
| 776 | input, |
| 777 | outputExpected, |
| 778 | inputInfo, |
| 779 | outputInfo); |
| 780 | } |
| 781 | |
| 782 | template<armnn::DataType ArmnnType, typename T> |
| 783 | LayerTestResult<T, 2> ReverseV2OddRowEvenColTest2Dim( |
| 784 | armnn::IWorkloadFactory& workloadFactory, |
| 785 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 786 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 787 | { |
| 788 | // Simple test with default descriptor. No axes set so output is |
| 789 | // the same as input |
| 790 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 791 | |
| 792 | float qScale = 1.0f; |
| 793 | int32_t qOffset = 0; |
| 794 | |
| 795 | armnn::TensorInfo inputInfo({3, 4}, ArmnnType, qScale, qOffset); |
| 796 | armnn::TensorInfo outputInfo({3, 4}, ArmnnType, qScale, qOffset); |
| 797 | |
| 798 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 799 | 1, 2, 3, 4, |
| 800 | 5, 6, 7, 8, |
| 801 | 9, 10, 11, 12 |
| 802 | }, qScale, qOffset); |
| 803 | |
| 804 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 805 | 4, 3, 2, 1, |
| 806 | 8, 7, 6, 5, |
| 807 | 12, 11, 10, 9 |
| 808 | }, qScale, qOffset); |
| 809 | |
| 810 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 811 | memoryManager, |
| 812 | tensorHandleFactory, |
| 813 | descriptor, |
| 814 | input, |
| 815 | outputExpected, |
| 816 | inputInfo, |
| 817 | outputInfo); |
| 818 | } |
| 819 | |
| 820 | template<armnn::DataType ArmnnType, typename T> |
| 821 | LayerTestResult<T, 2> ReverseV2OddRowEvenColTest3Dim( |
| 822 | armnn::IWorkloadFactory& workloadFactory, |
| 823 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 824 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 825 | { |
| 826 | // Simple test with default descriptor. No axes set so output is |
| 827 | // the same as input |
| 828 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1}); |
| 829 | |
| 830 | float qScale = 1.0f; |
| 831 | int32_t qOffset = 0; |
| 832 | |
| 833 | armnn::TensorInfo inputInfo({3, 4, 1}, ArmnnType, qScale, qOffset); |
| 834 | armnn::TensorInfo outputInfo({3, 4, 1}, ArmnnType, qScale, qOffset); |
| 835 | |
| 836 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 837 | 1, 2, 3, 4, |
| 838 | 5, 6, 7, 8, |
| 839 | 9, 10, 11, 12 |
| 840 | }, qScale, qOffset); |
| 841 | |
| 842 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 843 | 4, 3, 2, 1, |
| 844 | 8, 7, 6, 5, |
| 845 | 12, 11, 10, 9 |
| 846 | }, qScale, qOffset); |
| 847 | |
| 848 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 849 | memoryManager, |
| 850 | tensorHandleFactory, |
| 851 | descriptor, |
| 852 | input, |
| 853 | outputExpected, |
| 854 | inputInfo, |
| 855 | outputInfo); |
| 856 | } |
| 857 | |
| 858 | template<armnn::DataType ArmnnType, typename T> |
| 859 | LayerTestResult<T, 2> ReverseV2NegAxisTest2Dim1Axis( |
| 860 | armnn::IWorkloadFactory& workloadFactory, |
| 861 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 862 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 863 | { |
| 864 | // Simple test with default descriptor. No axes set so output is |
| 865 | // the same as input |
| 866 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {-1}); |
| 867 | |
| 868 | float qScale = 1.0f; |
| 869 | int32_t qOffset = 0; |
| 870 | |
| 871 | armnn::TensorInfo inputInfo({2, 4}, ArmnnType, qScale, qOffset); |
| 872 | armnn::TensorInfo outputInfo({2, 4}, ArmnnType, qScale, qOffset); |
| 873 | |
| 874 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 875 | 1, 2, 3, 4, |
| 876 | 5, 6, 7, 8, |
| 877 | }, qScale, qOffset); |
| 878 | |
| 879 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 880 | 4, 3, 2, 1, |
| 881 | 8, 7, 6, 5 |
| 882 | }, qScale, qOffset); |
| 883 | |
| 884 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 885 | memoryManager, |
| 886 | tensorHandleFactory, |
| 887 | descriptor, |
| 888 | input, |
| 889 | outputExpected, |
| 890 | inputInfo, |
| 891 | outputInfo); |
| 892 | } |
| 893 | |
| 894 | template<armnn::DataType ArmnnType, typename T> |
| 895 | LayerTestResult<T, 2> ReverseV2NegAxisTest3Dim2Axis( |
| 896 | armnn::IWorkloadFactory& workloadFactory, |
| 897 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 898 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 899 | { |
| 900 | // Simple test with default descriptor. No axes set so output is |
| 901 | // the same as input |
| 902 | auto descriptor = armnn::ReverseV2Descriptor(std::vector<int> {1, -1}); |
| 903 | |
| 904 | float qScale = 1.0f; |
| 905 | int32_t qOffset = 0; |
| 906 | |
| 907 | armnn::TensorInfo inputInfo({2, 4, 1}, ArmnnType, qScale, qOffset); |
| 908 | armnn::TensorInfo outputInfo({2, 4, 1}, ArmnnType, qScale, qOffset); |
| 909 | |
| 910 | std::vector<T> input = armnnUtils::QuantizedVector<T>({ |
| 911 | 1, 2, 3, 4, |
| 912 | 5, 6, 7, 8, |
| 913 | }, qScale, qOffset); |
| 914 | |
| 915 | std::vector<T> outputExpected = armnnUtils::QuantizedVector<T>({ |
| 916 | 4, 3, 2, 1, |
| 917 | 8, 7, 6, 5 |
| 918 | }, qScale, qOffset); |
| 919 | |
| 920 | return ReverseV2TestImpl<ArmnnType, T, 2>(workloadFactory, |
| 921 | memoryManager, |
| 922 | tensorHandleFactory, |
| 923 | descriptor, |
| 924 | input, |
| 925 | outputExpected, |
| 926 | inputInfo, |
| 927 | outputInfo); |
| 928 | } |
| 929 | |
| 930 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 931 | ReverseV2SimpleTestEmptyAxis<armnn::DataType::Float32>( |
| 932 | armnn::IWorkloadFactory& workloadFactory, |
| 933 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 934 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 935 | |
| 936 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 937 | ReverseV2SimpleTestEmptyTensor<armnn::DataType::Float32>( |
| 938 | armnn::IWorkloadFactory& workloadFactory, |
| 939 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 940 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 941 | |
| 942 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 943 | ReverseV2SimpleTest1Dim<armnn::DataType::Float32>( |
| 944 | armnn::IWorkloadFactory& workloadFactory, |
| 945 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 946 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 947 | |
| 948 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 949 | ReverseV2SimpleTest2Dim1Axis<armnn::DataType::Float32>( |
| 950 | armnn::IWorkloadFactory& workloadFactory, |
| 951 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 952 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 953 | |
| 954 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 955 | ReverseV2SimpleTest2Dim2Axis<armnn::DataType::Float32>( |
| 956 | armnn::IWorkloadFactory& workloadFactory, |
| 957 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 958 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 959 | |
| 960 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 961 | ReverseV2SimpleTest3Dim1Axis<armnn::DataType::Float32>( |
| 962 | armnn::IWorkloadFactory& workloadFactory, |
| 963 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 964 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 965 | |
| 966 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 967 | ReverseV2SimpleTest3Dim2Axis<armnn::DataType::Float32>( |
| 968 | armnn::IWorkloadFactory& workloadFactory, |
| 969 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 970 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 971 | |
| 972 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 973 | ReverseV2SimpleTest3Dim3Axis<armnn::DataType::Float32>( |
| 974 | armnn::IWorkloadFactory& workloadFactory, |
| 975 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 976 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 977 | |
| 978 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 979 | ReverseV2SimpleTest4Dim1Axis<armnn::DataType::Float32>( |
| 980 | armnn::IWorkloadFactory& workloadFactory, |
| 981 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 982 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 983 | |
| 984 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 985 | ReverseV2SimpleTest4Dim2Axis<armnn::DataType::Float32>( |
| 986 | armnn::IWorkloadFactory& workloadFactory, |
| 987 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 988 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 989 | |
| 990 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 991 | ReverseV2SimpleTest4Dim3Axis<armnn::DataType::Float32>( |
| 992 | armnn::IWorkloadFactory& workloadFactory, |
| 993 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 994 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 995 | |
| 996 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 997 | ReverseV2SimpleTest4Dim4Axis<armnn::DataType::Float32>( |
| 998 | armnn::IWorkloadFactory& workloadFactory, |
| 999 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1000 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1001 | |
| 1002 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1003 | ReverseV2EvenRowOddColTest2Dim<armnn::DataType::Float32>( |
| 1004 | armnn::IWorkloadFactory& workloadFactory, |
| 1005 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1006 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1007 | |
| 1008 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1009 | ReverseV2EvenRowOddColTest3Dim<armnn::DataType::Float32>( |
| 1010 | armnn::IWorkloadFactory& workloadFactory, |
| 1011 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1012 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1013 | |
| 1014 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1015 | ReverseV2EvenRowEvenColTest2Dim<armnn::DataType::Float32>( |
| 1016 | armnn::IWorkloadFactory& workloadFactory, |
| 1017 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1018 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1019 | |
| 1020 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1021 | ReverseV2EvenRowEvenColTest3Dim<armnn::DataType::Float32>( |
| 1022 | armnn::IWorkloadFactory& workloadFactory, |
| 1023 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1024 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1025 | |
| 1026 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1027 | ReverseV2OddRowOddColTest2Dim<armnn::DataType::Float32>( |
| 1028 | armnn::IWorkloadFactory& workloadFactory, |
| 1029 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1030 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1031 | |
| 1032 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1033 | ReverseV2OddRowOddColTest3Dim<armnn::DataType::Float32>( |
| 1034 | armnn::IWorkloadFactory& workloadFactory, |
| 1035 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1036 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1037 | |
| 1038 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1039 | ReverseV2OddRowEvenColTest2Dim<armnn::DataType::Float32>( |
| 1040 | armnn::IWorkloadFactory& workloadFactory, |
| 1041 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1042 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1043 | |
| 1044 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1045 | ReverseV2OddRowEvenColTest3Dim<armnn::DataType::Float32>( |
| 1046 | armnn::IWorkloadFactory& workloadFactory, |
| 1047 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1048 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1049 | |
| 1050 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1051 | ReverseV2NegAxisTest2Dim1Axis<armnn::DataType::Float32>( |
| 1052 | armnn::IWorkloadFactory& workloadFactory, |
| 1053 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1054 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1055 | |
| 1056 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float32>, 2> |
| 1057 | ReverseV2NegAxisTest3Dim2Axis<armnn::DataType::Float32>( |
| 1058 | armnn::IWorkloadFactory& workloadFactory, |
| 1059 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1060 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1061 | |
| 1062 | template LayerTestResult<armnn::ResolveType<armnn::DataType::Float16>, 2> |
| 1063 | ReverseV2SimpleTest2Dim2Axis<armnn::DataType::Float16>( |
| 1064 | armnn::IWorkloadFactory& workloadFactory, |
| 1065 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1066 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1067 | |
| 1068 | template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmS8>, 2> |
| 1069 | ReverseV2SimpleTest2Dim2Axis<armnn::DataType::QAsymmS8>( |
| 1070 | armnn::IWorkloadFactory& workloadFactory, |
| 1071 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1072 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1073 | |
| 1074 | template LayerTestResult<armnn::ResolveType<armnn::DataType::QAsymmU8>, 2> |
| 1075 | ReverseV2SimpleTest2Dim2Axis<armnn::DataType::QAsymmU8>( |
| 1076 | armnn::IWorkloadFactory& workloadFactory, |
| 1077 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1078 | const armnn::ITensorHandleFactory& tensorHandleFactory); |
| 1079 | |
| 1080 | template LayerTestResult<armnn::ResolveType<armnn::DataType::QSymmS16>, 2> |
| 1081 | ReverseV2SimpleTest2Dim2Axis<armnn::DataType::QSymmS16>( |
| 1082 | armnn::IWorkloadFactory& workloadFactory, |
| 1083 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1084 | const armnn::ITensorHandleFactory& tensorHandleFactory); |