telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. 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 | // |
| 5 | #pragma once |
| 6 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 7 | #include <armnn/ArmNN.hpp> |
| 8 | #include <armnn/Tensor.hpp> |
| 9 | |
| 10 | #include <Half.hpp> |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 11 | #include "TensorCopyUtils.hpp" |
| 12 | #include "WorkloadTestUtils.hpp" |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 13 | #include "TensorUtils.hpp" |
| 14 | #include "Permute.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 16 | #include <backendsCommon/CpuTensorHandle.hpp> |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 17 | #include <backendsCommon/IBackendInternal.hpp> |
| 18 | #include <backendsCommon/IMemoryManager.hpp> |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 19 | #include <reference/workloads/Decoders.hpp> |
| 20 | #include <reference/workloads/Encoders.hpp> |
| 21 | #include <test/TensorHelpers.hpp> |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 22 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | #include <boost/multi_array.hpp> |
| 24 | #include <boost/assert.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 25 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 26 | #include <array> |
| 27 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 28 | // Layer callables. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 29 | |
| 30 | namespace armnn |
| 31 | { |
| 32 | class IWorkloadFactory; |
| 33 | } |
| 34 | |
| 35 | template <std::size_t n> |
| 36 | boost::array<unsigned int, n> GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo) |
| 37 | { |
| 38 | BOOST_ASSERT_MSG(n == tensorInfo.GetNumDimensions(), |
| 39 | "Attempting to construct a shape array of mismatching size"); |
| 40 | |
| 41 | boost::array<unsigned int, n> shape; |
| 42 | for (unsigned int i = 0; i < n; i++) |
| 43 | { |
| 44 | shape[i] = tensorInfo.GetShape()[i]; |
| 45 | } |
| 46 | return shape; |
| 47 | } |
| 48 | |
| 49 | template <typename T, std::size_t n> |
| 50 | struct LayerTestResult |
| 51 | { |
| 52 | LayerTestResult(const armnn::TensorInfo& outputInfo) |
| 53 | { |
| 54 | auto shape( GetTensorShapeAsArray<n>(outputInfo) ); |
| 55 | output.resize(shape); |
| 56 | outputExpected.resize(shape); |
| 57 | supported = true; |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 58 | compareBoolean = false; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | boost::multi_array<T, n> output; |
| 62 | boost::multi_array<T, n> outputExpected; |
| 63 | bool supported; |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 64 | bool compareBoolean; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 65 | }; |
| 66 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 67 | LayerTestResult<float, 4> SimpleConvolution2d3x5Test( |
| 68 | armnn::IWorkloadFactory& workloadFactory, |
| 69 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 70 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 71 | const armnn::DataLayout layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 72 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 73 | LayerTestResult<float, 4> SimpleConvolution2d3x3Test( |
| 74 | armnn::IWorkloadFactory& workloadFactory, |
| 75 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 76 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 77 | const armnn::DataLayout layout); |
Francis Murtagh | d59116e | 2018-10-04 16:03:07 +0100 | [diff] [blame] | 78 | |
Mike Kelly | 7332ed8 | 2018-12-20 17:03:06 +0000 | [diff] [blame] | 79 | LayerTestResult<float, 4> SimpleConvolution2d3x3Stride2x2Test( |
| 80 | armnn::IWorkloadFactory& workloadFactory, |
| 81 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 82 | bool biasEnabled, |
| 83 | const armnn::DataLayout layout); |
| 84 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 85 | LayerTestResult<float, 4> SimpleConvolution2d3x3NhwcTest( |
| 86 | armnn::IWorkloadFactory& workloadFactory, |
| 87 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 88 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 89 | |
Teresa Charlin | edeeb16 | 2019-06-14 11:09:19 +0100 | [diff] [blame] | 90 | LayerTestResult<float, 4> Convolution2dAsymmetricPaddingLargerThanHalfKernelSizeTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 91 | armnn::IWorkloadFactory& workloadFactory, |
| 92 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Teresa Charlin | edeeb16 | 2019-06-14 11:09:19 +0100 | [diff] [blame] | 93 | armnn::DataLayout layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 94 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 95 | LayerTestResult<float, 4> Convolution2dAsymmetricPaddingTest( |
| 96 | armnn::IWorkloadFactory& workloadFactory, |
| 97 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Teresa Charlin | edeeb16 | 2019-06-14 11:09:19 +0100 | [diff] [blame] | 98 | armnn::DataLayout layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 99 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 100 | LayerTestResult<float, 4> Convolution1dTest( |
| 101 | armnn::IWorkloadFactory& workloadFactory, |
| 102 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 103 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 104 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 105 | LayerTestResult<uint8_t, 4> Convolution1dUint8Test( |
| 106 | armnn::IWorkloadFactory& workloadFactory, |
| 107 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 108 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 109 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 110 | LayerTestResult<float, 4> DepthwiseConvolution2dTest( |
| 111 | armnn::IWorkloadFactory& workloadFactory, |
| 112 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 113 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 114 | const armnn::DataLayout layout); |
Nikhil Raj | cec6b65 | 2018-10-12 13:51:57 +0100 | [diff] [blame] | 115 | |
Teresa Charlin | edeeb16 | 2019-06-14 11:09:19 +0100 | [diff] [blame] | 116 | template<armnn::DataType ArmnnType, armnn::DataType ArmnnBType, typename T = armnn::ResolveType<ArmnnType>> |
| 117 | LayerTestResult<T, 4> Convolution2d3x3Dilation3x3Test( |
| 118 | armnn::IWorkloadFactory& workloadFactory, |
| 119 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 120 | bool biasEnabled, |
| 121 | const armnn::DataLayout layout); |
| 122 | |
| 123 | template<armnn::DataType ArmnnType, armnn::DataType ArmnnBType, typename T = armnn::ResolveType<ArmnnType>> |
| 124 | LayerTestResult<T, 4> Convolution2d2x3x3Dilation3x3Test( |
| 125 | armnn::IWorkloadFactory& workloadFactory, |
| 126 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 127 | bool biasEnabled, |
| 128 | const armnn::DataLayout layout); |
| 129 | |
Teresa Charlin | 20b1f88 | 2019-06-19 09:34:37 +0100 | [diff] [blame] | 130 | template<armnn::DataType ArmnnType, armnn::DataType ArmnnBType, typename T = armnn::ResolveType<ArmnnType>> |
Teresa Charlin | 2b7519d | 2019-07-09 15:45:35 +0100 | [diff] [blame] | 131 | LayerTestResult<T, 4> Convolution2d2x2Dilation2x2Padding2x2Stride3x3Test( |
| 132 | armnn::IWorkloadFactory &workloadFactory, |
| 133 | const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, |
| 134 | bool biasEnabled, |
| 135 | const armnn::DataLayout layout); |
| 136 | |
| 137 | template<armnn::DataType ArmnnType, armnn::DataType ArmnnBType, typename T = armnn::ResolveType<ArmnnType>> |
Teresa Charlin | 20b1f88 | 2019-06-19 09:34:37 +0100 | [diff] [blame] | 138 | LayerTestResult<T, 4> DepthwiseConvolution2d3x3Dilation3x3Test( |
| 139 | armnn::IWorkloadFactory& workloadFactory, |
| 140 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 141 | bool biasEnabled, |
| 142 | const armnn::DataLayout layout); |
| 143 | |
| 144 | template<armnn::DataType ArmnnType, armnn::DataType ArmnnBType, typename T = armnn::ResolveType<ArmnnType>> |
| 145 | LayerTestResult<T, 4> DepthwiseConvolution2d2x3x3Dilation3x3Test( |
| 146 | armnn::IWorkloadFactory& workloadFactory, |
| 147 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 148 | bool biasEnabled, |
| 149 | const armnn::DataLayout layout); |
| 150 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 151 | LayerTestResult<float, 4> DepthwiseConvolution2dDepthNhwcTest( |
| 152 | armnn::IWorkloadFactory& workloadFactory, |
| 153 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 154 | bool biasEnabled); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 155 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 156 | LayerTestResult<float, 4> DepthwiseConvolution2dDepthMul1Test( |
| 157 | armnn::IWorkloadFactory& workloadFactory, |
| 158 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 159 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 160 | const armnn::DataLayout layout); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 161 | |
Matthew Jackson | d6a9dee | 2019-07-22 13:53:24 +0100 | [diff] [blame] | 162 | LayerTestResult<float, 4> DepthwiseConvolution2dDepthMul64Test( |
| 163 | armnn::IWorkloadFactory& workloadFactory, |
| 164 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 165 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 166 | LayerTestResult<float, 4> DepthwiseConvolution2dAsymmetricTest( |
| 167 | armnn::IWorkloadFactory& workloadFactory, |
| 168 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 169 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 170 | const armnn::DataLayout layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 171 | |
Teresa Charlin | 20b1f88 | 2019-06-19 09:34:37 +0100 | [diff] [blame] | 172 | LayerTestResult<float, 4> SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest( |
| 173 | armnn::IWorkloadFactory& workloadFactory, |
| 174 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Bruno Goncalves | 22972f0 | 2019-04-26 21:03:24 -0300 | [diff] [blame] | 175 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 176 | LayerTestResult<float, 4> CompareDepthwiseConvolution2dFloatTest( |
| 177 | armnn::IWorkloadFactory& workloadFactory, |
| 178 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 179 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 180 | const armnn::DataLayout layout); |
| 181 | |
| 182 | LayerTestResult<uint8_t, 4> CompareDepthwiseConvolution2dUint8Test( |
| 183 | armnn::IWorkloadFactory& workloadFactory, |
| 184 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 185 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 186 | const armnn::DataLayout layout); |
| 187 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 188 | LayerTestResult<float, 4> SimpleMaxPooling2dSize2x2Stride2x2Test( |
| 189 | armnn::IWorkloadFactory& workloadFactory, |
| 190 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 191 | bool forceNoPadding); |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 192 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 193 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dSize2x2Stride2x2Uint8Test( |
| 194 | armnn::IWorkloadFactory& workloadFactory, |
| 195 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 196 | bool forceNoPadding); |
James Conroy | 45a9b77 | 2018-10-31 11:47:53 +0000 | [diff] [blame] | 197 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 198 | LayerTestResult<int16_t, 4> SimpleMaxPooling2dSize2x2Stride2x2Int16Test( |
| 199 | armnn::IWorkloadFactory& workloadFactory, |
| 200 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 201 | bool forceNoPadding); |
| 202 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 203 | LayerTestResult<float, 4> SimpleMaxPooling2dSize3x3Stride2x4Test( |
| 204 | armnn::IWorkloadFactory& workloadFactory, |
| 205 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 206 | bool forceNoPadding); |
| 207 | |
| 208 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dSize3x3Stride2x4Uint8Test( |
| 209 | armnn::IWorkloadFactory& workloadFactory, |
| 210 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 211 | bool forceNoPadding ); |
| 212 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 213 | LayerTestResult<int16_t, 4> SimpleMaxPooling2dSize3x3Stride2x4Int16Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 214 | armnn::IWorkloadFactory& workloadFactory, |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 215 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 216 | bool forceNoPadding ); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 217 | |
| 218 | LayerTestResult<float, 4> SimpleMaxPooling2dTest( |
| 219 | armnn::IWorkloadFactory& workloadFactory, |
| 220 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 221 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 222 | |
| 223 | LayerTestResult<uint8_t, 4> SimpleMaxPooling2dUint8Test( |
| 224 | armnn::IWorkloadFactory& workloadFactory, |
| 225 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 226 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 227 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 228 | LayerTestResult<int16_t, 4> SimpleMaxPooling2dInt16Test( |
| 229 | armnn::IWorkloadFactory& workloadFactory, |
| 230 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 231 | const armnn::DataLayout dataLayout); |
| 232 | |
| 233 | LayerTestResult<float, 4> IgnorePaddingSimpleMaxPooling2dTest( |
| 234 | armnn::IWorkloadFactory& workloadFactory, |
| 235 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 236 | |
| 237 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleMaxPooling2dUint8Test( |
| 238 | armnn::IWorkloadFactory& workloadFactory, |
| 239 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 240 | |
| 241 | LayerTestResult<int16_t, 4> IgnorePaddingSimpleMaxPooling2dInt16Test( |
| 242 | armnn::IWorkloadFactory& workloadFactory, |
| 243 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 244 | |
| 245 | LayerTestResult<float, 4> IgnorePaddingMaxPooling2dSize3Test( |
| 246 | armnn::IWorkloadFactory& workloadFactory, |
| 247 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 248 | |
| 249 | LayerTestResult<uint8_t, 4> IgnorePaddingMaxPooling2dSize3Uint8Test( |
| 250 | armnn::IWorkloadFactory& workloadFactory, |
| 251 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 252 | |
| 253 | LayerTestResult<int16_t, 4> IgnorePaddingMaxPooling2dSize3Int16Test( |
| 254 | armnn::IWorkloadFactory& workloadFactory, |
| 255 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 256 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 257 | LayerTestResult<float, 4> SimpleAveragePooling2dTest( |
| 258 | armnn::IWorkloadFactory& workloadFactory, |
| 259 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 260 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 261 | |
| 262 | LayerTestResult<uint8_t, 4> SimpleAveragePooling2dUint8Test( |
| 263 | armnn::IWorkloadFactory& workloadFactory, |
| 264 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 265 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 266 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 267 | LayerTestResult<int16_t, 4> SimpleAveragePooling2dInt16Test( |
| 268 | armnn::IWorkloadFactory& workloadFactory, |
| 269 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 270 | const armnn::DataLayout dataLayout); |
| 271 | |
| 272 | LayerTestResult<float, 4> LargeTensorsAveragePooling2dTest( |
| 273 | armnn::IWorkloadFactory& workloadFactory, |
| 274 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 275 | |
| 276 | LayerTestResult<uint8_t, 4> LargeTensorsAveragePooling2dUint8Test( |
| 277 | armnn::IWorkloadFactory& workloadFactory, |
| 278 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 279 | |
| 280 | LayerTestResult<int16_t, 4> LargeTensorsAveragePooling2dInt16Test( |
| 281 | armnn::IWorkloadFactory& workloadFactory, |
| 282 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 283 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 284 | LayerTestResult<float, 4> IgnorePaddingAveragePooling2dSize3x2Stride2x2Test( |
| 285 | armnn::IWorkloadFactory& workloadFactory, |
| 286 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 287 | bool forceNoPadding); |
| 288 | |
| 289 | LayerTestResult<float, 4> IgnorePaddingSimpleAveragePooling2dTest( |
| 290 | armnn::IWorkloadFactory& workloadFactory, |
| 291 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 292 | |
| 293 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleAveragePooling2dUint8Test( |
| 294 | armnn::IWorkloadFactory& workloadFactory, |
| 295 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 296 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 297 | LayerTestResult<int16_t, 4> IgnorePaddingSimpleAveragePooling2dInt16Test( |
| 298 | armnn::IWorkloadFactory& workloadFactory, |
| 299 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 300 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 301 | LayerTestResult<float, 4> IgnorePaddingSimpleAveragePooling2dNoPaddingTest( |
| 302 | armnn::IWorkloadFactory& workloadFactory, |
| 303 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 304 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 305 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 306 | armnn::IWorkloadFactory& workloadFactory, |
| 307 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 308 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 309 | LayerTestResult<int16_t, 4> IgnorePaddingSimpleAveragePooling2dNoPaddingInt16Test( |
| 310 | armnn::IWorkloadFactory& workloadFactory, |
| 311 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 312 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 313 | LayerTestResult<float, 4> IgnorePaddingAveragePooling2dSize3Test( |
| 314 | armnn::IWorkloadFactory& workloadFactory, |
| 315 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 316 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 317 | LayerTestResult<uint8_t, 4> IgnorePaddingAveragePooling2dSize3Uint8Test( |
| 318 | armnn::IWorkloadFactory& workloadFactory, |
| 319 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 320 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 321 | LayerTestResult<int16_t, 4> IgnorePaddingAveragePooling2dSize3Int16Test( |
| 322 | armnn::IWorkloadFactory& workloadFactory, |
| 323 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 324 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 325 | LayerTestResult<float, 4> SimpleL2Pooling2dTest( |
| 326 | armnn::IWorkloadFactory& workloadFactory, |
| 327 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 328 | const armnn::DataLayout dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 329 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 330 | LayerTestResult<uint8_t, 4> SimpleL2Pooling2dUint8Test( |
| 331 | armnn::IWorkloadFactory& workloadFactory, |
| 332 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 333 | const armnn::DataLayout dataLayout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 334 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 335 | LayerTestResult<int16_t, 4> SimpleL2Pooling2dInt16Test( |
| 336 | armnn::IWorkloadFactory& workloadFactory, |
| 337 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 338 | const armnn::DataLayout dataLayout); |
| 339 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 340 | LayerTestResult<float, 4> L2Pooling2dSize3Stride1Test( |
| 341 | armnn::IWorkloadFactory& workloadFactory, |
| 342 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 343 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 344 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride1Uint8Test( |
| 345 | armnn::IWorkloadFactory& workloadFactory, |
| 346 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 347 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 348 | LayerTestResult<int16_t, 4> L2Pooling2dSize3Stride1Int16Test( |
| 349 | armnn::IWorkloadFactory& workloadFactory, |
| 350 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 351 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 352 | LayerTestResult<float, 4> L2Pooling2dSize3Stride3Test( |
| 353 | armnn::IWorkloadFactory& workloadFactory, |
| 354 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 355 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 356 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride3Uint8Test( |
| 357 | armnn::IWorkloadFactory& workloadFactory, |
| 358 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 359 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 360 | LayerTestResult<int16_t, 4> L2Pooling2dSize3Stride3Int16Test( |
| 361 | armnn::IWorkloadFactory& workloadFactory, |
| 362 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 363 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 364 | LayerTestResult<float, 4> L2Pooling2dSize3Stride4Test( |
| 365 | armnn::IWorkloadFactory& workloadFactory, |
| 366 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 367 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 368 | LayerTestResult<uint8_t, 4> L2Pooling2dSize3Stride4Uint8Test( |
| 369 | armnn::IWorkloadFactory& workloadFactory, |
| 370 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 371 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 372 | LayerTestResult<int16_t, 4> L2Pooling2dSize3Stride4Int16Test( |
| 373 | armnn::IWorkloadFactory& workloadFactory, |
| 374 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 375 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 376 | LayerTestResult<float, 4> L2Pooling2dSize7Test( |
| 377 | armnn::IWorkloadFactory& workloadFactory, |
| 378 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 379 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 380 | LayerTestResult<uint8_t, 4> L2Pooling2dSize7Uint8Test( |
| 381 | armnn::IWorkloadFactory& workloadFactory, |
| 382 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 383 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 384 | LayerTestResult<int16_t, 4> L2Pooling2dSize7Int16Test( |
| 385 | armnn::IWorkloadFactory& workloadFactory, |
| 386 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 387 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 388 | LayerTestResult<float, 4> L2Pooling2dSize9Test( |
| 389 | armnn::IWorkloadFactory& workloadFactory, |
| 390 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 391 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 392 | LayerTestResult<uint8_t, 4> L2Pooling2dSize9Uint8Test( |
| 393 | armnn::IWorkloadFactory& workloadFactory, |
| 394 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 395 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 396 | LayerTestResult<int16_t, 4> L2Pooling2dSize9Int16Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 397 | armnn::IWorkloadFactory& workloadFactory, |
| 398 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 399 | |
| 400 | LayerTestResult<float, 4> IgnorePaddingSimpleL2Pooling2dTest( |
| 401 | armnn::IWorkloadFactory& workloadFactory, |
| 402 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 403 | |
| 404 | LayerTestResult<uint8_t, 4> IgnorePaddingSimpleL2Pooling2dUint8Test( |
| 405 | armnn::IWorkloadFactory& workloadFactory, |
| 406 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 407 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 408 | LayerTestResult<int16_t, 4> IgnorePaddingSimpleL2Pooling2dInt16Test( |
| 409 | armnn::IWorkloadFactory& workloadFactory, |
| 410 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 411 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 412 | LayerTestResult<float, 4> IgnorePaddingL2Pooling2dSize3Test( |
| 413 | armnn::IWorkloadFactory& workloadFactory, |
| 414 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 415 | |
| 416 | LayerTestResult<uint8_t, 4> IgnorePaddingL2Pooling2dSize3Uint8Test( |
| 417 | armnn::IWorkloadFactory& workloadFactory, |
| 418 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 419 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 420 | LayerTestResult<int16_t, 4> IgnorePaddingL2Pooling2dSize3Int16Test( |
| 421 | armnn::IWorkloadFactory& workloadFactory, |
| 422 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 423 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 424 | LayerTestResult<float, 4> AsymmetricNonSquarePooling2dTest( |
| 425 | armnn::IWorkloadFactory& workloadFactory, |
| 426 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 427 | |
| 428 | LayerTestResult<uint8_t, 4> AsymmetricNonSquarePooling2dUint8Test( |
| 429 | armnn::IWorkloadFactory& workloadFactory, |
| 430 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 431 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 432 | LayerTestResult<int16_t, 4> AsymmetricNonSquarePooling2dInt16Test( |
| 433 | armnn::IWorkloadFactory& workloadFactory, |
| 434 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 435 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 436 | LayerTestResult<float, 4> ComparePooling2dTest( |
| 437 | armnn::IWorkloadFactory& workloadFactory, |
| 438 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 439 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 440 | armnn::PoolingAlgorithm poolingType); |
| 441 | |
| 442 | LayerTestResult<uint8_t, 4> ComparePooling2dUint8Test( |
| 443 | armnn::IWorkloadFactory& workloadFactory, |
| 444 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 445 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 446 | armnn::PoolingAlgorithm poolingType); |
| 447 | |
Teresa Charlin | 0434df6 | 2019-06-06 13:40:35 +0100 | [diff] [blame] | 448 | LayerTestResult<int16_t, 4> ComparePooling2dInt16Test( |
| 449 | armnn::IWorkloadFactory& workloadFactory, |
| 450 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 451 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 452 | armnn::PoolingAlgorithm poolingType); |
| 453 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 454 | LayerTestResult<float, 4> ConstantLinearActivationTest( |
| 455 | armnn::IWorkloadFactory& workloadFactory, |
| 456 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 457 | |
| 458 | LayerTestResult<float, 4> SimpleNormalizationAcrossTest( |
| 459 | armnn::IWorkloadFactory& workloadFactory, |
| 460 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 461 | |
| 462 | LayerTestResult<float, 4> SimpleNormalizationWithinTest( |
| 463 | armnn::IWorkloadFactory& workloadFactory, |
| 464 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 465 | |
| 466 | LayerTestResult<float,4> SimpleNormalizationAcrossNhwcTest( |
| 467 | armnn::IWorkloadFactory& workloadFactory, |
| 468 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 469 | |
| 470 | LayerTestResult<float, 2> SimpleSoftmaxTest( |
| 471 | armnn::IWorkloadFactory& workloadFactory, |
| 472 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 473 | float beta); |
| 474 | |
Francis Murtagh | 07f2121 | 2019-07-23 09:50:50 +0100 | [diff] [blame] | 475 | LayerTestResult<float, 2> SimpleAxisSoftmaxTest( |
| 476 | armnn::IWorkloadFactory& workloadFactory, |
| 477 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 478 | float beta, |
| 479 | int axis); |
| 480 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 481 | LayerTestResult<float, 3> Simple3dSoftmaxTest( |
| 482 | armnn::IWorkloadFactory& workloadFactory, |
| 483 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 484 | float beta); |
| 485 | |
Francis Murtagh | 07f2121 | 2019-07-23 09:50:50 +0100 | [diff] [blame] | 486 | LayerTestResult<float, 3> Simple3dAxisSoftmaxTest( |
| 487 | armnn::IWorkloadFactory& workloadFactory, |
| 488 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 489 | float beta, |
| 490 | int axis); |
| 491 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 492 | LayerTestResult<float, 4> Simple4dSoftmaxTest( |
| 493 | armnn::IWorkloadFactory& workloadFactory, |
| 494 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 495 | float beta); |
| 496 | |
Francis Murtagh | 07f2121 | 2019-07-23 09:50:50 +0100 | [diff] [blame] | 497 | LayerTestResult<float, 4> Simple4dAxisSoftmaxTest( |
| 498 | armnn::IWorkloadFactory& workloadFactory, |
| 499 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 500 | float beta, |
| 501 | int axis); |
| 502 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 503 | LayerTestResult<uint8_t, 2> SimpleSoftmaxUint8Test( |
| 504 | armnn::IWorkloadFactory& workloadFactory, |
| 505 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 506 | float beta); |
| 507 | |
Narumol Prangnawarat | 65d3096 | 2019-03-14 11:55:03 +0000 | [diff] [blame] | 508 | LayerTestResult<uint8_t,3> Simple3dSoftmaxUint8Test( |
| 509 | armnn::IWorkloadFactory& workloadFactory, |
| 510 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 511 | float beta); |
| 512 | |
| 513 | LayerTestResult<uint8_t,4> Simple4dSoftmaxUint8Test( |
| 514 | armnn::IWorkloadFactory& workloadFactory, |
| 515 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 516 | float beta); |
| 517 | |
nikraj01 | 248683f | 2019-05-29 16:46:50 +0100 | [diff] [blame] | 518 | LayerTestResult<int16_t,2> SimpleSoftmaxUint16Test( |
| 519 | armnn::IWorkloadFactory& workloadFactory, |
| 520 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 521 | float beta); |
| 522 | |
| 523 | LayerTestResult<int16_t,3> Simple3dSoftmaxUint16Test( |
| 524 | armnn::IWorkloadFactory& workloadFactory, |
| 525 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 526 | float beta); |
| 527 | |
| 528 | LayerTestResult<int16_t,4> Simple4dSoftmaxUint16Test( |
| 529 | armnn::IWorkloadFactory& workloadFactory, |
| 530 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 531 | float beta); |
| 532 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 533 | LayerTestResult<float, 4> SimpleSigmoidTest( |
| 534 | armnn::IWorkloadFactory& workloadFactory, |
| 535 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 536 | |
Nina Drozd | 8ed4b8c | 2019-05-29 10:41:04 +0100 | [diff] [blame] | 537 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 538 | LayerTestResult<T, 4> SimpleReshapeTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 539 | armnn::IWorkloadFactory& workloadFactory, |
| 540 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 541 | |
| 542 | LayerTestResult<float, 4> SimpleFloorTest( |
| 543 | armnn::IWorkloadFactory& workloadFactory, |
| 544 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 545 | |
| 546 | LayerTestResult<float, 1> Concatenation1dTest( |
| 547 | armnn::IWorkloadFactory& workloadFactory, |
| 548 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 549 | |
| 550 | LayerTestResult<float, 2> Concatenation2dDim0Test( |
| 551 | armnn::IWorkloadFactory& workloadFactory, |
| 552 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 553 | |
| 554 | LayerTestResult<float, 2> Concatenation2dDim1Test( |
| 555 | armnn::IWorkloadFactory& workloadFactory, |
| 556 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 557 | |
| 558 | LayerTestResult<float, 2> Concatenation2dDim0DiffInputDimsTest( |
| 559 | armnn::IWorkloadFactory& workloadFactory, |
| 560 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 561 | |
| 562 | LayerTestResult<float, 2> Concatenation2dDim1DiffInputDimsTest( |
| 563 | armnn::IWorkloadFactory& workloadFactory, |
| 564 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 565 | |
| 566 | LayerTestResult<float, 3> Concatenation3dDim0Test( |
| 567 | armnn::IWorkloadFactory& workloadFactory, |
| 568 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 569 | |
| 570 | LayerTestResult<float, 3> Concatenation3dDim1Test( |
| 571 | armnn::IWorkloadFactory& workloadFactory, |
| 572 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 573 | |
| 574 | LayerTestResult<float, 3> Concatenation3dDim2Test( |
| 575 | armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 576 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 577 | bool useSubtensor); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 578 | |
| 579 | LayerTestResult<float, 3> Concatenation3dDim0DiffInputDimsTest( |
| 580 | armnn::IWorkloadFactory& workloadFactory, |
| 581 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 582 | |
| 583 | LayerTestResult<float, 3> Concatenation3dDim1DiffInputDimsTest( |
| 584 | armnn::IWorkloadFactory& workloadFactory, |
| 585 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 586 | |
| 587 | LayerTestResult<float, 3> Concatenation3dDim2DiffInputDimsTest( |
| 588 | armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 589 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 590 | bool useSubtensor); |
| 591 | |
| 592 | LayerTestResult<float, 4> Concatenation4dDim0Test( |
| 593 | armnn::IWorkloadFactory& workloadFactory, |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 594 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 595 | |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 596 | LayerTestResult<float, 4> Concatenation4dDim1Test( |
| 597 | armnn::IWorkloadFactory& workloadFactory, |
| 598 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 599 | |
| 600 | LayerTestResult<float, 4> Concatenation4dDim2Test( |
| 601 | armnn::IWorkloadFactory& workloadFactory, |
| 602 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 603 | |
| 604 | LayerTestResult<float, 4> Concatenation4dDim3Test( |
| 605 | armnn::IWorkloadFactory& workloadFactory, |
| 606 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 607 | bool useSubtensor); |
| 608 | |
| 609 | LayerTestResult<float, 4> Concatenation4dDiffShapeDim0Test( |
| 610 | armnn::IWorkloadFactory& workloadFactory, |
| 611 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 612 | |
| 613 | LayerTestResult<float, 4> Concatenation4dDiffShapeDim1Test( |
| 614 | armnn::IWorkloadFactory& workloadFactory, |
| 615 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 616 | |
| 617 | LayerTestResult<float, 4> Concatenation4dDiffShapeDim2Test( |
| 618 | armnn::IWorkloadFactory& workloadFactory, |
| 619 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 620 | |
| 621 | LayerTestResult<float, 4> Concatenation4dDiffShapeDim3Test( |
| 622 | armnn::IWorkloadFactory& workloadFactory, |
| 623 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 624 | bool useSubtensor); |
| 625 | |
| 626 | LayerTestResult<uint8_t, 4> Concatenation4dDim0Uint8Test( |
| 627 | armnn::IWorkloadFactory& workloadFactory, |
| 628 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 629 | |
| 630 | LayerTestResult<uint8_t, 4> Concatenation4dDim1Uint8Test( |
| 631 | armnn::IWorkloadFactory& workloadFactory, |
| 632 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 633 | |
| 634 | LayerTestResult<uint8_t, 4> Concatenation4dDim2Uint8Test( |
| 635 | armnn::IWorkloadFactory& workloadFactory, |
| 636 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 637 | |
| 638 | LayerTestResult<uint8_t, 4> Concatenation4dDim3Uint8Test( |
| 639 | armnn::IWorkloadFactory& workloadFactory, |
| 640 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 641 | bool useSubtensor); |
| 642 | |
| 643 | LayerTestResult<uint8_t, 4> Concatenation4dDiffShapeDim0Uint8Test( |
| 644 | armnn::IWorkloadFactory& workloadFactory, |
| 645 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 646 | |
| 647 | LayerTestResult<uint8_t, 4> Concatenation4dDiffShapeDim1Uint8Test( |
| 648 | armnn::IWorkloadFactory& workloadFactory, |
| 649 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 650 | |
| 651 | LayerTestResult<uint8_t, 4> Concatenation4dDiffShapeDim2Uint8Test( |
| 652 | armnn::IWorkloadFactory& workloadFactory, |
| 653 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 654 | |
| 655 | LayerTestResult<uint8_t, 4> Concatenation4dDiffShapeDim3Uint8Test( |
| 656 | armnn::IWorkloadFactory& workloadFactory, |
| 657 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 658 | bool useSubtensor); |
| 659 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 660 | LayerTestResult<uint8_t, 4> SimpleSigmoidUint8Test( |
| 661 | armnn::IWorkloadFactory& workloadFactory, |
| 662 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 663 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 664 | LayerTestResult<int16_t, 4> SimpleSigmoidInt16Test( |
| 665 | armnn::IWorkloadFactory& workloadFactory, |
| 666 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 667 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 668 | LayerTestResult<float, 4> CompareConvolution2dTest( |
| 669 | armnn::IWorkloadFactory& workloadFactory, |
| 670 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 671 | armnn::IWorkloadFactory& refWorkloadFactory); |
| 672 | |
| 673 | template<typename T> |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 674 | LayerTestResult<T, 4> CompareDepthwiseConvolution2dTest( |
| 675 | armnn::IWorkloadFactory& workloadFactory, |
| 676 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 677 | armnn::IWorkloadFactory& refWorkloadFactory, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 678 | const armnn::DataLayout layout); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 679 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 680 | LayerTestResult<float, 4> CompareNormalizationTest( |
| 681 | armnn::IWorkloadFactory& workloadFactory, |
| 682 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 683 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 684 | armnn::NormalizationAlgorithmChannel normChannel, |
| 685 | armnn::NormalizationAlgorithmMethod normMethod); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 686 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 687 | LayerTestResult<float, 2> CompareSoftmaxTest( |
| 688 | armnn::IWorkloadFactory& workloadFactory, |
| 689 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 690 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 691 | float beta); |
| 692 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 693 | LayerTestResult<float, 2> FullyConnectedFloat32Test( |
| 694 | armnn::IWorkloadFactory& workloadFactory, |
| 695 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 696 | bool biasEnabled, |
| 697 | bool transposeWeights); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 698 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 699 | std::vector<LayerTestResult<float, 3>> SplitterTest( |
| 700 | armnn::IWorkloadFactory& workloadFactory, |
| 701 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
David Beck | 5cd01f3 | 2018-09-12 16:00:08 +0100 | [diff] [blame] | 702 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 703 | LayerTestResult<float, 3> CopyViaSplitterTest( |
| 704 | armnn::IWorkloadFactory& workloadFactory, |
| 705 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 706 | |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 707 | LayerTestResult<float, 3> ConcatTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 708 | armnn::IWorkloadFactory& workloadFactory, |
| 709 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 710 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 711 | LayerTestResult<float, 4> AdditionTest( |
| 712 | armnn::IWorkloadFactory& workloadFactory, |
| 713 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 714 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 715 | LayerTestResult<float, 4> AdditionBroadcast1ElementTest( |
| 716 | armnn::IWorkloadFactory& workloadFactory, |
| 717 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 718 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 719 | LayerTestResult<float, 4> AdditionBroadcastTest( |
| 720 | armnn::IWorkloadFactory& workloadFactory, |
| 721 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 722 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 723 | LayerTestResult<float, 4> CompareAdditionTest( |
| 724 | armnn::IWorkloadFactory& workloadFactory, |
| 725 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 726 | armnn::IWorkloadFactory& refWorkloadFactory); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 727 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 728 | LayerTestResult<float, 4> SubtractionTest( |
| 729 | armnn::IWorkloadFactory& workloadFactory, |
| 730 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 731 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 732 | LayerTestResult<float, 4> SubtractionBroadcast1ElementTest( |
| 733 | armnn::IWorkloadFactory& workloadFactory, |
| 734 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 735 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 736 | LayerTestResult<float, 4> SubtractionBroadcastTest( |
| 737 | armnn::IWorkloadFactory& workloadFactory, |
| 738 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 739 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 740 | LayerTestResult<float, 4> CompareActivationTest( |
| 741 | armnn::IWorkloadFactory& workloadFactory, |
| 742 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 743 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 744 | armnn::ActivationFunction f, |
| 745 | unsigned int batchSize); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 746 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 747 | LayerTestResult<float, 4> DivisionTest( |
| 748 | armnn::IWorkloadFactory& workloadFactory, |
| 749 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 750 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 751 | LayerTestResult<float, 4> DivisionByZeroTest( |
| 752 | armnn::IWorkloadFactory& workloadFactory, |
| 753 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mohamed Nour Abouelseoud | 7420e55 | 2018-10-12 12:26:24 +0100 | [diff] [blame] | 754 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 755 | LayerTestResult<float, 4> DivisionBroadcast1ElementTest( |
| 756 | armnn::IWorkloadFactory& workloadFactory, |
| 757 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mohamed Nour Abouelseoud | 7420e55 | 2018-10-12 12:26:24 +0100 | [diff] [blame] | 758 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 759 | LayerTestResult<float, 4> DivisionBroadcast1DVectorTest( |
| 760 | armnn::IWorkloadFactory& workloadFactory, |
| 761 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 762 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 763 | LayerTestResult<float, 4> MultiplicationTest( |
| 764 | armnn::IWorkloadFactory& workloadFactory, |
| 765 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 766 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 767 | LayerTestResult<float, 4> MultiplicationBroadcast1ElementTest( |
| 768 | armnn::IWorkloadFactory& workloadFactory, |
| 769 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
narpra01 | 1e4c31d | 2018-09-28 11:07:51 +0100 | [diff] [blame] | 770 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 771 | LayerTestResult<float, 4> MultiplicationBroadcast1DVectorTest( |
| 772 | armnn::IWorkloadFactory& workloadFactory, |
| 773 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
narpra01 | 1e4c31d | 2018-09-28 11:07:51 +0100 | [diff] [blame] | 774 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 775 | LayerTestResult<float, 4> CompareMultiplicationTest( |
| 776 | armnn::IWorkloadFactory& workloadFactory, |
| 777 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 778 | armnn::IWorkloadFactory& refWorkloadFactory); |
Matteo Martincigh | 28dcab6 | 2018-10-19 16:40:03 +0100 | [diff] [blame] | 779 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 780 | LayerTestResult<float, 4> BatchNormTest( |
| 781 | armnn::IWorkloadFactory& workloadFactory, |
| 782 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | 3ea76d5 | 2018-11-09 14:10:38 +0000 | [diff] [blame] | 783 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 784 | LayerTestResult<float, 4> BatchNormNhwcTest( |
| 785 | armnn::IWorkloadFactory& workloadFactory, |
| 786 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | 3ea76d5 | 2018-11-09 14:10:38 +0000 | [diff] [blame] | 787 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 788 | LayerTestResult<float, 4> CompareBatchNormTest( |
| 789 | armnn::IWorkloadFactory& workloadFactory, |
| 790 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 791 | armnn::IWorkloadFactory& refWorkloadFactory); |
Nattapat Chaimanowong | 3ea76d5 | 2018-11-09 14:10:38 +0000 | [diff] [blame] | 792 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 793 | LayerTestResult<float, 4> BoundedReLuUpperAndLowerBoundTest( |
| 794 | armnn::IWorkloadFactory& workloadFactory, |
| 795 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | 3ea76d5 | 2018-11-09 14:10:38 +0000 | [diff] [blame] | 796 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 797 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperAndLowerBoundTest( |
| 798 | armnn::IWorkloadFactory& workloadFactor, |
| 799 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManagery); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 800 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 801 | LayerTestResult<float, 4> BoundedReLuUpperBoundOnlyTest( |
| 802 | armnn::IWorkloadFactory& workloadFactory, |
| 803 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 804 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 805 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperBoundOnlyTest( |
| 806 | armnn::IWorkloadFactory& workloadFactory, |
| 807 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Éanna Ó Catháin | 262553e | 2018-11-14 11:26:23 +0000 | [diff] [blame] | 808 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 809 | LayerTestResult<float, 4> CompareBoundedReLuTest( |
| 810 | armnn::IWorkloadFactory& workloadFactory, |
| 811 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 812 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 813 | float upperBound, |
| 814 | float lowerBound); |
| 815 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 816 | LayerTestResult<float, 4> ReLuTest( |
| 817 | armnn::IWorkloadFactory& workloadFactory, |
| 818 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 819 | |
| 820 | LayerTestResult<uint8_t, 4> ReLuUint8Test( |
| 821 | armnn::IWorkloadFactory& workloadFactory, |
| 822 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 823 | |
| 824 | LayerTestResult<int16_t, 4> ReLuInt16Test( |
| 825 | armnn::IWorkloadFactory& workloadFactory, |
| 826 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 827 | |
| 828 | LayerTestResult<int16_t, 4> BoundedReLuInt16Test( |
| 829 | armnn::IWorkloadFactory& workloadFactory, |
| 830 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 831 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 832 | LayerTestResult<float, 4> SoftReLuTest( |
| 833 | armnn::IWorkloadFactory& workloadFactory, |
| 834 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 835 | |
| 836 | LayerTestResult<uint8_t, 4> SoftReLuUint8Test( |
| 837 | armnn::IWorkloadFactory& workloadFactory, |
| 838 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 839 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 840 | LayerTestResult<int16_t, 4> SoftReLuInt16Test( |
| 841 | armnn::IWorkloadFactory& workloadFactory, |
| 842 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 843 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 844 | LayerTestResult<float, 4> LeakyReLuTest( |
| 845 | armnn::IWorkloadFactory& workloadFactory, |
| 846 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 847 | |
| 848 | LayerTestResult<uint8_t, 4> LeakyReLuUint8Test( |
| 849 | armnn::IWorkloadFactory& workloadFactory, |
| 850 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 851 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 852 | LayerTestResult<int16_t, 4> LeakyReLuInt16Test( |
| 853 | armnn::IWorkloadFactory& workloadFactory, |
| 854 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 855 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 856 | LayerTestResult<float, 4> AbsTest( |
| 857 | armnn::IWorkloadFactory& workloadFactory, |
| 858 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 859 | |
| 860 | LayerTestResult<uint8_t, 4> AbsUint8Test( |
| 861 | armnn::IWorkloadFactory& workloadFactory, |
| 862 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 863 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 864 | LayerTestResult<int16_t, 4> AbsInt16Test( |
| 865 | armnn::IWorkloadFactory& workloadFactory, |
| 866 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 867 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 868 | LayerTestResult<float, 4> SqrtTest( |
| 869 | armnn::IWorkloadFactory& workloadFactory, |
| 870 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 871 | |
| 872 | LayerTestResult<uint8_t, 4> SqrtUint8Test( |
| 873 | armnn::IWorkloadFactory& workloadFactory, |
| 874 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 875 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 876 | LayerTestResult<int16_t, 4> SqrtInt16Test( |
| 877 | armnn::IWorkloadFactory& workloadFactory, |
| 878 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 879 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 880 | LayerTestResult<float, 4> SquareTest( |
| 881 | armnn::IWorkloadFactory& workloadFactory, |
| 882 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 883 | |
| 884 | LayerTestResult<uint8_t, 4> SquareUint8Test( |
| 885 | armnn::IWorkloadFactory& workloadFactory, |
| 886 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 887 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 888 | LayerTestResult<int16_t, 4> SquareInt16Test( |
| 889 | armnn::IWorkloadFactory& workloadFactory, |
| 890 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 891 | |
konsof01 | 7f6db40 | 2019-06-07 15:15:58 +0100 | [diff] [blame] | 892 | LayerTestResult<float, 4> TanhTest( |
| 893 | armnn::IWorkloadFactory& workloadFactory, |
| 894 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 895 | |
| 896 | LayerTestResult<uint8_t, 4> TanhUint8Test( |
| 897 | armnn::IWorkloadFactory& workloadFactory, |
| 898 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 899 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 900 | LayerTestResult<int16_t, 4> TanhInt16Test( |
| 901 | armnn::IWorkloadFactory& workloadFactory, |
| 902 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 903 | |
| 904 | |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 905 | // Tests that the output should be identical to the input when the output dimensions match the input ones. |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 906 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 907 | LayerTestResult<T, 4> ResizeBilinearNopTest( |
| 908 | armnn::IWorkloadFactory& workloadFactory, |
| 909 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 910 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 911 | |
| 912 | // Tests the behaviour of the resize bilinear operation when rescaling a 2x2 image into a 1x1 image. |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 913 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 914 | LayerTestResult<T, 4> SimpleResizeBilinearTest( |
| 915 | armnn::IWorkloadFactory& workloadFactory, |
| 916 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 917 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 918 | |
| 919 | // Tests the resize bilinear for minification of a square input matrix (also: input dimensions are a |
| 920 | // multiple of output dimensions). |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 921 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 922 | LayerTestResult<T, 4> ResizeBilinearSqMinTest( |
| 923 | armnn::IWorkloadFactory& workloadFactory, |
| 924 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 925 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 926 | |
| 927 | // Tests the resize bilinear for minification (output dimensions smaller than input dimensions). |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 928 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 929 | LayerTestResult<T, 4> ResizeBilinearMinTest( |
| 930 | armnn::IWorkloadFactory& workloadFactory, |
| 931 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 932 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 933 | |
| 934 | // Tests the resize bilinear for magnification (output dimensions bigger than input dimensions). |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 935 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 936 | LayerTestResult<T, 4> ResizeBilinearMagTest( |
| 937 | armnn::IWorkloadFactory& workloadFactory, |
| 938 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 939 | const armnn::DataLayout dataLayout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 940 | |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 941 | // Tests that the output should be identical to the input when the output dimensions match the input ones. |
| 942 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 943 | LayerTestResult<T, 4> ResizeNearestNeighborNopTest( |
| 944 | armnn::IWorkloadFactory& workloadFactory, |
| 945 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 946 | const armnn::DataLayout dataLayout); |
| 947 | |
| 948 | // Tests the behaviour of the resize NearestNeighbor operation when rescaling a 2x2 image into a 1x1 image. |
| 949 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 950 | LayerTestResult<T, 4> SimpleResizeNearestNeighborTest( |
| 951 | armnn::IWorkloadFactory& workloadFactory, |
| 952 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 953 | const armnn::DataLayout dataLayout); |
| 954 | |
| 955 | // Tests the resize NearestNeighbor for minification of a square input matrix (also: input dimensions are a |
| 956 | // multiple of output dimensions). |
| 957 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 958 | LayerTestResult<T, 4> ResizeNearestNeighborSqMinTest( |
| 959 | armnn::IWorkloadFactory& workloadFactory, |
| 960 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 961 | const armnn::DataLayout dataLayout); |
| 962 | |
| 963 | // Tests the resize NearestNeighbor for minification (output dimensions smaller than input dimensions). |
| 964 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 965 | LayerTestResult<T, 4> ResizeNearestNeighborMinTest( |
| 966 | armnn::IWorkloadFactory& workloadFactory, |
| 967 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 968 | const armnn::DataLayout dataLayout); |
| 969 | |
| 970 | // Tests the resize NearestNeighbor for magnification (output dimensions bigger than input dimensions). |
| 971 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 972 | LayerTestResult<T, 4> ResizeNearestNeighborMagTest( |
| 973 | armnn::IWorkloadFactory& workloadFactory, |
| 974 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 975 | const armnn::DataLayout dataLayout, |
| 976 | float inQuantScale, |
| 977 | int32_t inQuantOffset, |
| 978 | float outQuantScale, |
| 979 | int32_t outQuantOffset); |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 980 | |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 981 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 982 | LayerTestResult<T, 2> Rsqrt2dTestCommon( |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 983 | armnn::IWorkloadFactory& workloadFactory, |
| 984 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 985 | const armnn::TensorInfo inputTensorInfo, |
| 986 | const armnn::TensorInfo outputTensorInfo, |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 987 | const std::vector<float>& inputValues, |
| 988 | const std::vector<float>& expectedOutputValues); |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 989 | |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 990 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 991 | LayerTestResult<T, 2> Rsqrt2dTest( |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 992 | armnn::IWorkloadFactory& workloadFactory, |
| 993 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 994 | |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 995 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 996 | LayerTestResult<T, 3> Rsqrt3dTest( |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 997 | armnn::IWorkloadFactory& workloadFactory, |
| 998 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 999 | |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 1000 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1001 | LayerTestResult<T, 2> RsqrtZeroTest( |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 1002 | armnn::IWorkloadFactory& workloadFactory, |
| 1003 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1004 | |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 1005 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1006 | LayerTestResult<T, 2> RsqrtNegativeTest( |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 1007 | armnn::IWorkloadFactory& workloadFactory, |
| 1008 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1009 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1010 | LayerTestResult<float, 4> BatchNormTest( |
| 1011 | armnn::IWorkloadFactory& workloadFactory, |
| 1012 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1013 | |
| 1014 | LayerTestResult<float, 4> BatchNormNhwcTest( |
| 1015 | armnn::IWorkloadFactory& workloadFactory, |
| 1016 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1017 | |
| 1018 | LayerTestResult<float, 2> FakeQuantizationTest( |
| 1019 | armnn::IWorkloadFactory& workloadFactory, |
| 1020 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1021 | |
Ferran Balaguer | e52211e | 2019-06-17 12:23:52 +0100 | [diff] [blame] | 1022 | LayerTestResult<float, 4> L2NormalizationDefaultEpsilonTest( |
| 1023 | armnn::IWorkloadFactory& workloadFactory, |
| 1024 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1025 | const armnn::DataLayout layout); |
| 1026 | |
| 1027 | LayerTestResult<float, 4> L2NormalizationNonDefaultEpsilonTest( |
| 1028 | armnn::IWorkloadFactory& workloadFactory, |
| 1029 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1030 | const armnn::DataLayout layout); |
| 1031 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1032 | LayerTestResult<float, 4> L2Normalization1dTest( |
| 1033 | armnn::IWorkloadFactory& workloadFactory, |
| 1034 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1035 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1036 | |
Ferran Balaguer | d73d14f | 2019-06-10 10:29:54 +0100 | [diff] [blame] | 1037 | LayerTestResult<int16_t, 4> L2Normalization1dInt16Test( |
| 1038 | armnn::IWorkloadFactory& workloadFactory, |
| 1039 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1040 | const armnn::DataLayout layout); |
| 1041 | |
Ferran Balaguer | c6138d8 | 2019-06-13 17:23:50 +0100 | [diff] [blame] | 1042 | LayerTestResult<uint8_t, 4> L2Normalization1dUint8Test( |
| 1043 | armnn::IWorkloadFactory& workloadFactory, |
| 1044 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1045 | const armnn::DataLayout layout); |
| 1046 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1047 | LayerTestResult<float, 4> L2Normalization2dTest( |
| 1048 | armnn::IWorkloadFactory& workloadFactory, |
| 1049 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1050 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1051 | |
Ferran Balaguer | d73d14f | 2019-06-10 10:29:54 +0100 | [diff] [blame] | 1052 | LayerTestResult<int16_t, 4> L2Normalization2dInt16Test( |
| 1053 | armnn::IWorkloadFactory& workloadFactory, |
| 1054 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1055 | const armnn::DataLayout layout); |
| 1056 | |
Ferran Balaguer | c6138d8 | 2019-06-13 17:23:50 +0100 | [diff] [blame] | 1057 | LayerTestResult<uint8_t, 4> L2Normalization2dUint8Test( |
| 1058 | armnn::IWorkloadFactory& workloadFactory, |
| 1059 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1060 | const armnn::DataLayout layout); |
| 1061 | |
Matthew Jackson | 82b15ed | 2019-07-25 16:14:30 +0100 | [diff] [blame] | 1062 | LayerTestResult<float, 2> L2Normalization2dShapeTest( |
| 1063 | armnn::IWorkloadFactory& workloadFactory, |
| 1064 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1065 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1066 | LayerTestResult<float, 4> L2Normalization3dTest( |
| 1067 | armnn::IWorkloadFactory& workloadFactory, |
| 1068 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1069 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1070 | |
Ferran Balaguer | d73d14f | 2019-06-10 10:29:54 +0100 | [diff] [blame] | 1071 | LayerTestResult<int16_t, 4> L2Normalization3dInt16Test( |
| 1072 | armnn::IWorkloadFactory& workloadFactory, |
| 1073 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1074 | const armnn::DataLayout layout); |
| 1075 | |
Ferran Balaguer | c6138d8 | 2019-06-13 17:23:50 +0100 | [diff] [blame] | 1076 | LayerTestResult<uint8_t, 4> L2Normalization3dUint8Test( |
| 1077 | armnn::IWorkloadFactory& workloadFactory, |
| 1078 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1079 | const armnn::DataLayout layout); |
| 1080 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1081 | LayerTestResult<float, 4> L2Normalization4dTest( |
| 1082 | armnn::IWorkloadFactory& workloadFactory, |
| 1083 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1084 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1085 | |
Ferran Balaguer | d73d14f | 2019-06-10 10:29:54 +0100 | [diff] [blame] | 1086 | LayerTestResult<int16_t, 4> L2Normalization4dInt16Test( |
| 1087 | armnn::IWorkloadFactory& workloadFactory, |
| 1088 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1089 | const armnn::DataLayout layout); |
| 1090 | |
Ferran Balaguer | c6138d8 | 2019-06-13 17:23:50 +0100 | [diff] [blame] | 1091 | LayerTestResult<uint8_t, 4> L2Normalization4dUint8Test( |
| 1092 | armnn::IWorkloadFactory& workloadFactory, |
| 1093 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1094 | const armnn::DataLayout layout); |
| 1095 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1096 | LayerTestResult<float, 4> ConstantTest( |
| 1097 | armnn::IWorkloadFactory& workloadFactory, |
| 1098 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1099 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 1100 | LayerTestResult<uint8_t, 4> ConstantUint8SimpleQuantizationScaleNoOffsetTest( |
| 1101 | armnn::IWorkloadFactory& workloadFactory, |
| 1102 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1103 | |
| 1104 | LayerTestResult<int16_t, 4> ConstantInt16SimpleQuantizationScaleNoOffsetTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1105 | armnn::IWorkloadFactory& workloadFactory, |
| 1106 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1107 | |
| 1108 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test( |
| 1109 | armnn::IWorkloadFactory& workloadFactory, |
| 1110 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1111 | float upperBound); |
| 1112 | |
| 1113 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test( |
| 1114 | armnn::IWorkloadFactory& workloadFactory, |
| 1115 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1116 | float upperBound, |
| 1117 | float lowerBound); |
| 1118 | |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 1119 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1120 | LayerTestResult<T, 2> FullyConnectedTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1121 | armnn::IWorkloadFactory& workloadFactory, |
| 1122 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1123 | bool biasEnabled); |
| 1124 | |
| 1125 | std::vector<LayerTestResult<uint8_t, 3>> SplitterUint8Test( |
| 1126 | armnn::IWorkloadFactory& workloadFactory, |
| 1127 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1128 | |
Ruomei Yan | 25339c3 | 2019-05-28 16:48:20 +0100 | [diff] [blame] | 1129 | std::vector<LayerTestResult<int16_t, 3>> SplitterInt16Test( |
| 1130 | armnn::IWorkloadFactory& workloadFactory, |
| 1131 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1132 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1133 | LayerTestResult<uint8_t, 3> CopyViaSplitterUint8Test( |
| 1134 | armnn::IWorkloadFactory& workloadFactory, |
| 1135 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1136 | |
Ruomei Yan | 25339c3 | 2019-05-28 16:48:20 +0100 | [diff] [blame] | 1137 | LayerTestResult<int16_t, 3> CopyViaSplitterInt16Test( |
| 1138 | armnn::IWorkloadFactory& workloadFactory, |
| 1139 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1140 | |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1141 | LayerTestResult<uint8_t, 3> ConcatUint8Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1142 | armnn::IWorkloadFactory& workloadFactory, |
| 1143 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1144 | |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1145 | LayerTestResult<uint16_t, 3> ConcatUint16Test( |
Jim Flynn | cbb66aa | 2019-05-15 13:03:54 +0100 | [diff] [blame] | 1146 | armnn::IWorkloadFactory& workloadFactory, |
| 1147 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1148 | |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1149 | LayerTestResult<uint8_t, 3> ConcatUint8DifferentQParamsTest( |
Jim Flynn | cbb66aa | 2019-05-15 13:03:54 +0100 | [diff] [blame] | 1150 | armnn::IWorkloadFactory& workloadFactory, |
| 1151 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Ferran Balaguer | b284565 | 2019-02-27 09:42:06 +0000 | [diff] [blame] | 1152 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1153 | LayerTestResult<uint8_t, 4> AdditionUint8Test( |
| 1154 | armnn::IWorkloadFactory& workloadFactory, |
| 1155 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1156 | |
| 1157 | LayerTestResult<uint8_t, 4> AdditionBroadcast1ElementUint8Test( |
| 1158 | armnn::IWorkloadFactory& workloadFactory, |
| 1159 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1160 | |
| 1161 | LayerTestResult<uint8_t, 4> AdditionBroadcastUint8Test( |
| 1162 | armnn::IWorkloadFactory& workloadFactory, |
| 1163 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1164 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1165 | LayerTestResult<int16_t, 4> AdditionInt16Test( |
| 1166 | armnn::IWorkloadFactory& workloadFactory, |
| 1167 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1168 | |
| 1169 | LayerTestResult<int16_t, 4> AdditionBroadcastInt16Test( |
| 1170 | armnn::IWorkloadFactory& workloadFactory, |
| 1171 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1172 | |
| 1173 | LayerTestResult<int16_t, 4> AdditionBroadcast1ElementInt16Test( |
| 1174 | armnn::IWorkloadFactory& workloadFactory, |
| 1175 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1176 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1177 | LayerTestResult<uint8_t, 4> SubtractionUint8Test( |
| 1178 | armnn::IWorkloadFactory& workloadFactory, |
| 1179 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1180 | |
| 1181 | LayerTestResult<uint8_t, 4> SubtractionBroadcast1ElementUint8Test( |
| 1182 | armnn::IWorkloadFactory& workloadFactory, |
| 1183 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1184 | |
| 1185 | LayerTestResult<uint8_t, 4> SubtractionBroadcastUint8Test( |
| 1186 | armnn::IWorkloadFactory& workloadFactory, |
| 1187 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1188 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1189 | LayerTestResult<int16_t, 4> SubtractionInt16Test( |
| 1190 | armnn::IWorkloadFactory& workloadFactory, |
| 1191 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1192 | |
| 1193 | LayerTestResult<int16_t, 4> SubtractionBroadcast1ElementInt16Test( |
| 1194 | armnn::IWorkloadFactory& workloadFactory, |
| 1195 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1196 | |
| 1197 | LayerTestResult<int16_t, 4> SubtractionBroadcastInt16Test( |
| 1198 | armnn::IWorkloadFactory& workloadFactory, |
| 1199 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1200 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1201 | LayerTestResult<uint8_t, 4> CompareActivationUint8Test( |
| 1202 | armnn::IWorkloadFactory& workloadFactory, |
| 1203 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1204 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 1205 | armnn::ActivationFunction f); |
| 1206 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 1207 | LayerTestResult<int16_t, 4> CompareActivationInt16Test( |
| 1208 | armnn::IWorkloadFactory& workloadFactory, |
| 1209 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1210 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 1211 | armnn::ActivationFunction f); |
| 1212 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1213 | LayerTestResult<uint8_t, 2> CompareSoftmaxUint8Test( |
| 1214 | armnn::IWorkloadFactory& workloadFactory, |
| 1215 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1216 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 1217 | float beta); |
| 1218 | |
| 1219 | LayerTestResult<uint8_t, 4> MultiplicationUint8Test( |
| 1220 | armnn::IWorkloadFactory& workloadFactory, |
| 1221 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1222 | |
| 1223 | LayerTestResult<uint8_t, 4> MultiplicationBroadcast1ElementUint8Test( |
| 1224 | armnn::IWorkloadFactory& workloadFactory, |
| 1225 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1226 | |
| 1227 | LayerTestResult<uint8_t, 4> MultiplicationBroadcast1DVectorUint8Test( |
| 1228 | armnn::IWorkloadFactory& workloadFactory, |
| 1229 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1230 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1231 | LayerTestResult<int16_t, 4> MultiplicationInt16Test( |
| 1232 | armnn::IWorkloadFactory& workloadFactory, |
| 1233 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1234 | |
| 1235 | LayerTestResult<int16_t, 4> MultiplicationBroadcast1ElementInt16Test( |
| 1236 | armnn::IWorkloadFactory& workloadFactory, |
| 1237 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1238 | |
| 1239 | LayerTestResult<int16_t, 4> MultiplicationBroadcast1DVectorInt16Test( |
| 1240 | armnn::IWorkloadFactory& workloadFactory, |
| 1241 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1242 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1243 | LayerTestResult<uint8_t, 4> DivisionUint8Test( |
| 1244 | armnn::IWorkloadFactory& workloadFactory, |
| 1245 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1246 | |
| 1247 | LayerTestResult<uint8_t, 4> DivisionBroadcast1ElementUint8Test( |
| 1248 | armnn::IWorkloadFactory& workloadFactory, |
| 1249 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1250 | |
| 1251 | LayerTestResult<uint8_t, 4> DivisionBroadcast1DVectorUint8Test( |
| 1252 | armnn::IWorkloadFactory& workloadFactory, |
| 1253 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1254 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1255 | LayerTestResult<int16_t, 4> DivisionInt16Test( |
| 1256 | armnn::IWorkloadFactory& workloadFactory, |
| 1257 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1258 | |
| 1259 | LayerTestResult<int16_t, 4> DivisionBroadcast1ElementInt16Test( |
| 1260 | armnn::IWorkloadFactory& workloadFactory, |
| 1261 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1262 | |
| 1263 | LayerTestResult<int16_t, 4> DivisionBroadcast1DVectorInt16Test( |
| 1264 | armnn::IWorkloadFactory& workloadFactory, |
| 1265 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1266 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1267 | LayerTestResult<uint8_t, 4> SimpleConvolution2d3x5Uint8Test( |
| 1268 | armnn::IWorkloadFactory& workloadFactory, |
| 1269 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1270 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1271 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1272 | |
| 1273 | LayerTestResult<uint8_t, 4> SimpleConvolution2d3x3Uint8Test( |
| 1274 | armnn::IWorkloadFactory& workloadFactory, |
| 1275 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1276 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1277 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1278 | |
Mike Kelly | 2f80f6e | 2019-05-16 12:41:34 +0100 | [diff] [blame] | 1279 | LayerTestResult<int16_t, 4> SimpleConvolution2d3x5QSymm16Test( |
| 1280 | armnn::IWorkloadFactory& workloadFactory, |
| 1281 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1282 | bool biasEnabled, |
| 1283 | const armnn::DataLayout layout); |
| 1284 | |
| 1285 | LayerTestResult<int16_t, 4> SimpleConvolution2d3x3QSymm16Test( |
| 1286 | armnn::IWorkloadFactory& workloadFactory, |
| 1287 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1288 | bool biasEnabled, |
| 1289 | const armnn::DataLayout layout); |
| 1290 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1291 | LayerTestResult<uint8_t, 4> DepthwiseConvolution2dUint8Test( |
| 1292 | armnn::IWorkloadFactory& workloadFactory, |
| 1293 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1294 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1295 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1296 | |
| 1297 | LayerTestResult<uint8_t, 4> DepthwiseConvolution2dDepthMul1Uint8Test( |
| 1298 | armnn::IWorkloadFactory& workloadFactory, |
| 1299 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1300 | bool biasEnabled, |
Matthew Bentham | 8800c00 | 2018-11-19 13:19:28 +0000 | [diff] [blame] | 1301 | const armnn::DataLayout layout); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1302 | |
Ruomei Yan | 88d44b8 | 2019-05-23 14:29:06 +0100 | [diff] [blame] | 1303 | LayerTestResult<int16_t, 4> DepthwiseConvolution2dInt16Test( |
| 1304 | armnn::IWorkloadFactory& workloadFactory, |
| 1305 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1306 | bool biasEnabled, |
| 1307 | const armnn::DataLayout layout); |
| 1308 | |
| 1309 | LayerTestResult<int16_t, 4> DepthwiseConvolution2dDepthMul1Int16Test( |
| 1310 | armnn::IWorkloadFactory& workloadFactory, |
| 1311 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1312 | bool biasEnabled, |
| 1313 | const armnn::DataLayout layout); |
| 1314 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1315 | LayerTestResult<uint8_t, 4> ConstantLinearActivationUint8Test( |
| 1316 | armnn::IWorkloadFactory& workloadFactory, |
| 1317 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1318 | |
Teresa Charlin | 18515e2 | 2019-04-24 10:17:46 +0100 | [diff] [blame] | 1319 | LayerTestResult<int16_t, 4> ConstantLinearActivationInt16Test( |
| 1320 | armnn::IWorkloadFactory& workloadFactory, |
| 1321 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1322 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1323 | LayerTestResult<uint8_t, 4> BatchNormUint8Test( |
| 1324 | armnn::IWorkloadFactory& workloadFactory, |
| 1325 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1326 | |
| 1327 | LayerTestResult<uint8_t, 4> BatchNormUint8NhwcTest( |
| 1328 | armnn::IWorkloadFactory& workloadFactory, |
| 1329 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1330 | |
Matteo Martincigh | f550713 | 2019-06-04 10:59:47 +0100 | [diff] [blame] | 1331 | LayerTestResult<int16_t, 4> BatchNormInt16Test( |
| 1332 | armnn::IWorkloadFactory& workloadFactory, |
| 1333 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1334 | |
| 1335 | LayerTestResult<int16_t, 4> BatchNormInt16NhwcTest( |
| 1336 | armnn::IWorkloadFactory& workloadFactory, |
| 1337 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1338 | |
Nina Drozd | 58ef2c6 | 2019-05-16 12:09:18 +0100 | [diff] [blame] | 1339 | LayerTestResult<uint8_t, 4> ConstantUint8CustomQuantizationScaleAndOffsetTest( |
| 1340 | armnn::IWorkloadFactory& workloadFactory, |
| 1341 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1342 | |
| 1343 | LayerTestResult<int16_t, 4> ConstantInt16CustomQuantizationScaleAndOffsetTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1344 | armnn::IWorkloadFactory& workloadFactory, |
| 1345 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1346 | |
| 1347 | LayerTestResult<uint8_t, 1> Concatenation1dUint8Test( |
| 1348 | armnn::IWorkloadFactory& workloadFactory, |
| 1349 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1350 | |
| 1351 | LayerTestResult<uint8_t, 2> Concatenation2dDim0Uint8Test( |
| 1352 | armnn::IWorkloadFactory& workloadFactory, |
| 1353 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1354 | |
| 1355 | LayerTestResult<uint8_t, 2> Concatenation2dDim1Uint8Test( |
| 1356 | armnn::IWorkloadFactory& workloadFactory, |
| 1357 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1358 | |
| 1359 | LayerTestResult<uint8_t, 2> Concatenation2dDim0DiffInputDimsUint8Test( |
| 1360 | armnn::IWorkloadFactory& workloadFactory, |
| 1361 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1362 | |
| 1363 | LayerTestResult<uint8_t, 2> Concatenation2dDim1DiffInputDimsUint8Test( |
| 1364 | armnn::IWorkloadFactory& workloadFactory, |
| 1365 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1366 | |
| 1367 | LayerTestResult<uint8_t, 3> Concatenation3dDim0Uint8Test( |
| 1368 | armnn::IWorkloadFactory& workloadFactory, |
| 1369 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1370 | |
| 1371 | LayerTestResult<uint8_t, 3> Concatenation3dDim1Uint8Test( |
| 1372 | armnn::IWorkloadFactory& workloadFactory, |
| 1373 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1374 | |
| 1375 | LayerTestResult<uint8_t, 3> Concatenation3dDim2Uint8Test( |
| 1376 | armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 1377 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1378 | bool useSubtensor); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1379 | |
| 1380 | LayerTestResult<uint8_t, 3> Concatenation3dDim0DiffInputDimsUint8Test( |
| 1381 | armnn::IWorkloadFactory& workloadFactory, |
| 1382 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1383 | |
| 1384 | LayerTestResult<uint8_t, 3> Concatenation3dDim1DiffInputDimsUint8Test( |
| 1385 | armnn::IWorkloadFactory& workloadFactory, |
| 1386 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1387 | |
| 1388 | LayerTestResult<uint8_t, 3> Concatenation3dDim2DiffInputDimsUint8Test( |
| 1389 | armnn::IWorkloadFactory& workloadFactory, |
narpra01 | 5cdda35 | 2018-11-19 15:30:27 +0000 | [diff] [blame] | 1390 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1391 | bool useSubtensor); |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1392 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1393 | LayerTestResult<uint8_t, 4> EqualSimpleTest( |
FrancisMurtagh | 30cdfca | 2018-12-18 12:57:35 +0000 | [diff] [blame] | 1394 | armnn::IWorkloadFactory& workloadFactory, |
| 1395 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1396 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1397 | LayerTestResult<uint8_t, 4> EqualBroadcast1ElementTest( |
FrancisMurtagh | 30cdfca | 2018-12-18 12:57:35 +0000 | [diff] [blame] | 1398 | armnn::IWorkloadFactory& workloadFactory, |
| 1399 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1400 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1401 | LayerTestResult<uint8_t, 4> EqualBroadcast1DVectorTest( |
FrancisMurtagh | 30cdfca | 2018-12-18 12:57:35 +0000 | [diff] [blame] | 1402 | armnn::IWorkloadFactory& workloadFactory, |
| 1403 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1404 | |
| 1405 | LayerTestResult<uint8_t, 4> EqualUint8Test( |
| 1406 | armnn::IWorkloadFactory& workloadFactory, |
| 1407 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1408 | |
| 1409 | LayerTestResult<uint8_t, 4> EqualBroadcast1ElementUint8Test( |
| 1410 | armnn::IWorkloadFactory& workloadFactory, |
| 1411 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1412 | |
| 1413 | LayerTestResult<uint8_t, 4> EqualBroadcast1DVectorUint8Test( |
| 1414 | armnn::IWorkloadFactory& workloadFactory, |
| 1415 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1416 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1417 | LayerTestResult<uint8_t, 4> GreaterSimpleTest( |
FrancisMurtagh | 878f023 | 2018-12-19 10:56:15 +0000 | [diff] [blame] | 1418 | armnn::IWorkloadFactory& workloadFactory, |
| 1419 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1420 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1421 | LayerTestResult<uint8_t, 4> GreaterBroadcast1ElementTest( |
FrancisMurtagh | 878f023 | 2018-12-19 10:56:15 +0000 | [diff] [blame] | 1422 | armnn::IWorkloadFactory& workloadFactory, |
| 1423 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1424 | |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1425 | LayerTestResult<uint8_t, 4> GreaterBroadcast1DVectorTest( |
FrancisMurtagh | 878f023 | 2018-12-19 10:56:15 +0000 | [diff] [blame] | 1426 | armnn::IWorkloadFactory& workloadFactory, |
| 1427 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1428 | |
| 1429 | LayerTestResult<uint8_t, 4> GreaterUint8Test( |
| 1430 | armnn::IWorkloadFactory& workloadFactory, |
| 1431 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1432 | |
| 1433 | LayerTestResult<uint8_t, 4> GreaterBroadcast1ElementUint8Test( |
| 1434 | armnn::IWorkloadFactory& workloadFactory, |
| 1435 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1436 | |
| 1437 | LayerTestResult<uint8_t, 4> GreaterBroadcast1DVectorUint8Test( |
| 1438 | armnn::IWorkloadFactory& workloadFactory, |
| 1439 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1440 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1441 | LayerTestResult<float, 2> FullyConnectedLargeTest( |
| 1442 | armnn::IWorkloadFactory& workloadFactory, |
| 1443 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1444 | bool transposeWeights); |
| 1445 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1446 | LayerTestResult<uint8_t, 2> PadUint82dTest( |
| 1447 | armnn::IWorkloadFactory& workloadFactory, |
| 1448 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1449 | |
David Monahan | 3475781 | 2019-06-19 11:47:21 +0100 | [diff] [blame] | 1450 | LayerTestResult<uint8_t, 2> PadUint82dCustomPaddingTest( |
| 1451 | armnn::IWorkloadFactory& workloadFactory, |
| 1452 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1453 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1454 | LayerTestResult<uint8_t, 3> PadUint83dTest( |
| 1455 | armnn::IWorkloadFactory& workloadFactory, |
| 1456 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1457 | |
| 1458 | LayerTestResult<uint8_t, 4> PadUint84dTest( |
| 1459 | armnn::IWorkloadFactory& workloadFactory, |
| 1460 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1461 | |
| 1462 | LayerTestResult<float, 2> PadFloat322dTest( |
| 1463 | armnn::IWorkloadFactory& workloadFactory, |
| 1464 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1465 | |
David Monahan | 3475781 | 2019-06-19 11:47:21 +0100 | [diff] [blame] | 1466 | LayerTestResult<float, 2> PadFloat322dCustomPaddingTest( |
| 1467 | armnn::IWorkloadFactory& workloadFactory, |
| 1468 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1469 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1470 | LayerTestResult<float, 3> PadFloat323dTest( |
| 1471 | armnn::IWorkloadFactory& workloadFactory, |
| 1472 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1473 | |
| 1474 | LayerTestResult<float, 4> PadFloat324dTest( |
| 1475 | armnn::IWorkloadFactory& workloadFactory, |
| 1476 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1477 | |
Narumol Prangnawarat | e6eaf66 | 2019-07-08 08:57:17 +0100 | [diff] [blame] | 1478 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1479 | LayerTestResult<T, 2> Pad2dTestCommon( |
| 1480 | armnn::IWorkloadFactory& workloadFactory, |
| 1481 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1482 | float qScale, |
| 1483 | int32_t qOffset, |
| 1484 | const float customPaddingValue = 0.0f); |
| 1485 | |
| 1486 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1487 | LayerTestResult<T, 3> Pad3dTestCommon( |
| 1488 | armnn::IWorkloadFactory& workloadFactory, |
| 1489 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1490 | float qScale, |
| 1491 | int32_t qOffset); |
| 1492 | |
| 1493 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1494 | LayerTestResult<T, 4> Pad4dTestCommon( |
| 1495 | armnn::IWorkloadFactory& workloadFactory, |
| 1496 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 1497 | float qScale, |
| 1498 | int32_t qOffset); |
| 1499 | |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 1500 | void LstmUtilsZeroVectorTest(); |
| 1501 | void LstmUtilsMeanStddevNormalizationNoneZeroInputTest(); |
| 1502 | void LstmUtilsMeanStddevNormalizationAllZeroInputTest(); |
| 1503 | void LstmUtilsMeanStddevNormalizationMixedZeroInputTest(); |
| 1504 | void LstmUtilsVectorBatchVectorCwiseProductTest(); |
| 1505 | void LstmUtilsVectorBatchVectorAddTest(); |
| 1506 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1507 | LayerTestResult<float, 2> LstmLayerFloat32WithCifgWithPeepholeNoProjectionTest( |
| 1508 | armnn::IWorkloadFactory& workloadFactory, |
| 1509 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1510 | |
| 1511 | LayerTestResult<float, 2> LstmLayerFloat32NoCifgNoPeepholeNoProjectionTest( |
| 1512 | armnn::IWorkloadFactory& workloadFactory, |
| 1513 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1514 | |
| 1515 | LayerTestResult<float, 2> LstmLayerFloat32NoCifgWithPeepholeWithProjectionTest( |
| 1516 | armnn::IWorkloadFactory& workloadFactory, |
| 1517 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1518 | |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 1519 | LayerTestResult<float, 2> LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNormTest( |
| 1520 | armnn::IWorkloadFactory& workloadFactory, |
| 1521 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1522 | |
Conor Kennedy | b9971c9 | 2019-05-07 07:14:23 +0100 | [diff] [blame] | 1523 | LayerTestResult<int16_t, 2> LstmLayerInt16NoCifgNoPeepholeNoProjectionTest( |
| 1524 | armnn::IWorkloadFactory& workloadFactory, |
| 1525 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1526 | |
| 1527 | LayerTestResult<int16_t, 2> LstmLayerInt16WithCifgWithPeepholeNoProjectionTest( |
| 1528 | armnn::IWorkloadFactory& workloadFactory, |
| 1529 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1530 | |
| 1531 | LayerTestResult<int16_t, 2> LstmLayerInt16NoCifgWithPeepholeWithProjectionTest( |
| 1532 | armnn::IWorkloadFactory& workloadFactory, |
| 1533 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1534 | |
| 1535 | LayerTestResult<int16_t, 2> LstmLayerInt16NoCifgNoPeepholeNoProjectionInt16ConstantTest( |
| 1536 | armnn::IWorkloadFactory& workloadFactory, |
| 1537 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1538 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1539 | LayerTestResult<float, 4> SimpleConvertFp16ToFp32Test( |
| 1540 | armnn::IWorkloadFactory& workloadFactory, |
| 1541 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1542 | |
| 1543 | LayerTestResult<armnn::Half, 4> SimpleConvertFp32ToFp16Test( |
| 1544 | armnn::IWorkloadFactory& workloadFactory, |
| 1545 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1546 | |
Éanna Ó Catháin | de70558 | 2018-12-03 13:04:22 +0000 | [diff] [blame] | 1547 | LayerTestResult<float, 4> MaximumSimpleTest( |
| 1548 | armnn::IWorkloadFactory& workloadFactory, |
| 1549 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1550 | |
| 1551 | LayerTestResult<float, 4> MaximumBroadcast1ElementTest( |
| 1552 | armnn::IWorkloadFactory& workloadFactory, |
| 1553 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1554 | |
| 1555 | LayerTestResult<float, 4> MaximumBroadcast1DVectorTest( |
| 1556 | armnn::IWorkloadFactory& workloadFactory, |
| 1557 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1558 | |
| 1559 | LayerTestResult<uint8_t , 4> MaximumUint8Test( |
| 1560 | armnn::IWorkloadFactory& workloadFactory, |
| 1561 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1562 | |
| 1563 | LayerTestResult<uint8_t, 4> MaximumBroadcast1ElementUint8Test( |
| 1564 | armnn::IWorkloadFactory& workloadFactory, |
| 1565 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1566 | |
| 1567 | LayerTestResult<uint8_t, 4> MaximumBroadcast1DVectorUint8Test( |
| 1568 | armnn::IWorkloadFactory& workloadFactory, |
| 1569 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1570 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1571 | LayerTestResult<int16_t , 4> MaximumInt16Test( |
| 1572 | armnn::IWorkloadFactory& workloadFactory, |
| 1573 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1574 | |
| 1575 | LayerTestResult<int16_t, 4> MaximumBroadcast1ElementInt16Test( |
| 1576 | armnn::IWorkloadFactory& workloadFactory, |
| 1577 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1578 | |
| 1579 | LayerTestResult<int16_t, 4> MaximumBroadcast1DVectorInt16Test( |
| 1580 | armnn::IWorkloadFactory& workloadFactory, |
| 1581 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1582 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1583 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1584 | LayerTestResult<T, 1> MeanSimpleTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1585 | armnn::IWorkloadFactory& workloadFactory, |
| 1586 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1587 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1588 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1589 | LayerTestResult<T, 3> MeanSimpleAxisTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1590 | armnn::IWorkloadFactory& workloadFactory, |
| 1591 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1592 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1593 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1594 | LayerTestResult<T, 4> MeanKeepDimsTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1595 | armnn::IWorkloadFactory& workloadFactory, |
| 1596 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1597 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1598 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1599 | LayerTestResult<T, 4> MeanMultipleDimsTest( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1600 | armnn::IWorkloadFactory& workloadFactory, |
| 1601 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1602 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1603 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1604 | LayerTestResult<T, 1> MeanVts1Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1605 | armnn::IWorkloadFactory& workloadFactory, |
| 1606 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1607 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1608 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1609 | LayerTestResult<T, 3> MeanVts2Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1610 | armnn::IWorkloadFactory& workloadFactory, |
| 1611 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1612 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 1613 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 1614 | LayerTestResult<T, 3> MeanVts3Test( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1615 | armnn::IWorkloadFactory& workloadFactory, |
| 1616 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1617 | |
Éanna Ó Catháin | 20e5880 | 2018-12-04 10:29:06 +0000 | [diff] [blame] | 1618 | LayerTestResult<float, 4> MinimumBroadcast1ElementTest1( |
| 1619 | armnn::IWorkloadFactory& workloadFactory, |
| 1620 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1621 | |
| 1622 | LayerTestResult<float, 4> MinimumBroadcast1ElementTest2( |
| 1623 | armnn::IWorkloadFactory& workloadFactory, |
| 1624 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1625 | |
| 1626 | LayerTestResult<uint8_t, 4> MinimumBroadcast1DVectorUint8Test( |
| 1627 | armnn::IWorkloadFactory & workloadFactory, |
| 1628 | const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager); |
| 1629 | |
Sadik Armagan | 2999a02 | 2019-04-09 14:20:12 +0100 | [diff] [blame] | 1630 | LayerTestResult<int16_t , 4> MinimumInt16Test( |
| 1631 | armnn::IWorkloadFactory& workloadFactory, |
| 1632 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1633 | |
| 1634 | LayerTestResult<int16_t, 4> MinimumBroadcast1ElementInt16Test( |
| 1635 | armnn::IWorkloadFactory& workloadFactory, |
| 1636 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1637 | |
| 1638 | LayerTestResult<int16_t, 4> MinimumBroadcast1DVectorInt16Test( |
| 1639 | armnn::IWorkloadFactory& workloadFactory, |
| 1640 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1641 | |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1642 | LayerTestResult<float, 4> AdditionAfterMaxPoolTest( |
| 1643 | armnn::IWorkloadFactory& workloadFactory, |
| 1644 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1645 | |
| 1646 | LayerTestResult<float, 4> SpaceToBatchNdSimpleFloat32Test( |
| 1647 | armnn::IWorkloadFactory& workloadFactory, |
| 1648 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1649 | |
| 1650 | LayerTestResult<float, 4> SpaceToBatchNdMultiChannelsFloat32Test( |
| 1651 | armnn::IWorkloadFactory& workloadFactory, |
| 1652 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1653 | |
| 1654 | LayerTestResult<float, 4> SpaceToBatchNdMultiBlockFloat32Test( |
| 1655 | armnn::IWorkloadFactory& workloadFactory, |
| 1656 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1657 | |
| 1658 | LayerTestResult<float, 4> SpaceToBatchNdPaddingFloat32Test( |
| 1659 | armnn::IWorkloadFactory& workloadFactory, |
| 1660 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1661 | |
| 1662 | LayerTestResult<uint8_t, 4> SpaceToBatchNdSimpleUint8Test( |
| 1663 | armnn::IWorkloadFactory& workloadFactory, |
| 1664 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1665 | |
| 1666 | LayerTestResult<uint8_t, 4> SpaceToBatchNdMultiChannelsUint8Test( |
| 1667 | armnn::IWorkloadFactory& workloadFactory, |
| 1668 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1669 | |
| 1670 | LayerTestResult<uint8_t, 4> SpaceToBatchNdMultiBlockUint8Test( |
| 1671 | armnn::IWorkloadFactory& workloadFactory, |
| 1672 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1673 | |
| 1674 | LayerTestResult<uint8_t, 4> SpaceToBatchNdPaddingUint8Test( |
| 1675 | armnn::IWorkloadFactory& workloadFactory, |
| 1676 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1677 | |
| 1678 | LayerTestResult<float, 4> SpaceToBatchNdSimpleNHWCFloat32Test( |
| 1679 | armnn::IWorkloadFactory& workloadFactory, |
| 1680 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1681 | |
| 1682 | LayerTestResult<float, 4> SpaceToBatchNdMultiChannelsNHWCFloat32Test( |
| 1683 | armnn::IWorkloadFactory& workloadFactory, |
| 1684 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1685 | |
| 1686 | LayerTestResult<float, 4> SpaceToBatchNdMultiBlockNHWCFloat32Test( |
| 1687 | armnn::IWorkloadFactory& workloadFactory, |
| 1688 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1689 | |
| 1690 | LayerTestResult<float, 4> SpaceToBatchNdPaddingNHWCFloat32Test( |
| 1691 | armnn::IWorkloadFactory& workloadFactory, |
| 1692 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1693 | |
| 1694 | LayerTestResult<uint8_t, 4> SpaceToBatchNdSimpleNHWCUint8Test( |
| 1695 | armnn::IWorkloadFactory& workloadFactory, |
| 1696 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1697 | |
| 1698 | LayerTestResult<uint8_t, 4> SpaceToBatchNdMultiChannelsNHWCUint8Test( |
| 1699 | armnn::IWorkloadFactory& workloadFactory, |
| 1700 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1701 | |
| 1702 | LayerTestResult<uint8_t, 4> SpaceToBatchNdMultiBlockNHWCUint8Test( |
| 1703 | armnn::IWorkloadFactory& workloadFactory, |
| 1704 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1705 | |
| 1706 | LayerTestResult<uint8_t, 4> SpaceToBatchNdPaddingNHWCUint8Test( |
| 1707 | armnn::IWorkloadFactory& workloadFactory, |
| 1708 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1709 | |
nikraj01 | 120522a | 2019-05-31 11:33:07 +0100 | [diff] [blame] | 1710 | LayerTestResult<int16_t, 4> SpaceToBatchNdSimpleUint16Test( |
| 1711 | armnn::IWorkloadFactory& workloadFactory, |
| 1712 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1713 | |
| 1714 | LayerTestResult<int16_t, 4> SpaceToBatchNdMultiChannelsUint16Test( |
| 1715 | armnn::IWorkloadFactory& workloadFactory, |
| 1716 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1717 | |
| 1718 | LayerTestResult<int16_t, 4> SpaceToBatchNdMultiBlockUint16Test( |
| 1719 | armnn::IWorkloadFactory& workloadFactory, |
| 1720 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1721 | |
| 1722 | LayerTestResult<int16_t, 4> SpaceToBatchNdPaddingUint16Test( |
| 1723 | armnn::IWorkloadFactory& workloadFactory, |
| 1724 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1725 | |
| 1726 | LayerTestResult<int16_t, 4> SpaceToBatchNdSimpleNHWCUint16Test( |
| 1727 | armnn::IWorkloadFactory& workloadFactory, |
| 1728 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1729 | |
| 1730 | LayerTestResult<int16_t, 4> SpaceToBatchNdMultiChannelsNHWCUint16Test( |
| 1731 | armnn::IWorkloadFactory& workloadFactory, |
| 1732 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1733 | |
| 1734 | LayerTestResult<int16_t, 4> SpaceToBatchNdMultiBlockNHWCUint16Test( |
| 1735 | armnn::IWorkloadFactory& workloadFactory, |
| 1736 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1737 | |
| 1738 | LayerTestResult<int16_t, 4> SpaceToBatchNdPaddingNHWCUint16Test( |
| 1739 | armnn::IWorkloadFactory& workloadFactory, |
| 1740 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1741 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1742 | LayerTestResult<float, 4> BatchToSpaceNdNhwcTest1( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1743 | armnn::IWorkloadFactory& workloadFactory, |
| 1744 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1745 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1746 | LayerTestResult<float, 4> BatchToSpaceNdNhwcTest2( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1747 | armnn::IWorkloadFactory& workloadFactory, |
| 1748 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1749 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1750 | LayerTestResult<float, 4> BatchToSpaceNdNhwcTest3( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1751 | armnn::IWorkloadFactory& workloadFactory, |
| 1752 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1753 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1754 | LayerTestResult<float, 4> BatchToSpaceNdNhwcTest4( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1755 | armnn::IWorkloadFactory& workloadFactory, |
| 1756 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1757 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1758 | LayerTestResult<float, 4> BatchToSpaceNdNchwTest1( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1759 | armnn::IWorkloadFactory &workloadFactory, |
| 1760 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1761 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1762 | LayerTestResult<float, 4> BatchToSpaceNdNchwTest2( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1763 | armnn::IWorkloadFactory &workloadFactory, |
| 1764 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1765 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1766 | LayerTestResult<float, 4> BatchToSpaceNdNchwTest3( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1767 | armnn::IWorkloadFactory &workloadFactory, |
| 1768 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1769 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1770 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNhwcTest5( |
Aron Virginas-Tar | 5caf907 | 2018-11-14 18:35:18 +0000 | [diff] [blame] | 1771 | armnn::IWorkloadFactory &workloadFactory, |
| 1772 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | 1216b58 | 2018-11-23 15:33:41 +0000 | [diff] [blame] | 1773 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1774 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNhwcTest6( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1775 | armnn::IWorkloadFactory &workloadFactory, |
| 1776 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1777 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1778 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNhwcTest7( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1779 | armnn::IWorkloadFactory &workloadFactory, |
| 1780 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1781 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1782 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNchwTest4( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1783 | armnn::IWorkloadFactory &workloadFactory, |
| 1784 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1785 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1786 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNchwTest5( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1787 | armnn::IWorkloadFactory &workloadFactory, |
| 1788 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1789 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1790 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNchwTest6( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1791 | armnn::IWorkloadFactory &workloadFactory, |
| 1792 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1793 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 1794 | LayerTestResult<uint8_t, 4> BatchToSpaceNdNchwTest7( |
Nattapat Chaimanowong | 3ee1422 | 2019-02-27 10:28:09 +0000 | [diff] [blame] | 1795 | armnn::IWorkloadFactory &workloadFactory, |
| 1796 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Mike Kelly | 831faed | 2018-11-28 11:52:08 +0000 | [diff] [blame] | 1797 | |
Nattapat Chaimanowong | 1216b58 | 2018-11-23 15:33:41 +0000 | [diff] [blame] | 1798 | LayerTestResult<float, 4> StridedSlice4DFloat32Test( |
| 1799 | armnn::IWorkloadFactory& workloadFactory, |
| 1800 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 1801 | |
Nattapat Chaimanowong | 1216b58 | 2018-11-23 15:33:41 +0000 | [diff] [blame] | 1802 | LayerTestResult<float, 4> StridedSlice4DReverseFloat32Test( |
| 1803 | armnn::IWorkloadFactory& workloadFactory, |
| 1804 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1805 | |
| 1806 | LayerTestResult<float, 4> StridedSliceSimpleStrideFloat32Test( |
| 1807 | armnn::IWorkloadFactory& workloadFactory, |
| 1808 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1809 | |
| 1810 | LayerTestResult<float, 4> StridedSliceSimpleRangeMaskFloat32Test( |
| 1811 | armnn::IWorkloadFactory& workloadFactory, |
| 1812 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1813 | |
| 1814 | LayerTestResult<float, 2> StridedSliceShrinkAxisMaskFloat32Test( |
| 1815 | armnn::IWorkloadFactory& workloadFactory, |
| 1816 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1817 | |
| 1818 | LayerTestResult<float, 3> StridedSlice3DFloat32Test( |
| 1819 | armnn::IWorkloadFactory& workloadFactory, |
| 1820 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1821 | |
| 1822 | LayerTestResult<float, 3> StridedSlice3DReverseFloat32Test( |
| 1823 | armnn::IWorkloadFactory& workloadFactory, |
| 1824 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1825 | |
| 1826 | LayerTestResult<float, 2> StridedSlice2DFloat32Test( |
| 1827 | armnn::IWorkloadFactory& workloadFactory, |
| 1828 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1829 | |
| 1830 | LayerTestResult<float, 2> StridedSlice2DReverseFloat32Test( |
| 1831 | armnn::IWorkloadFactory& workloadFactory, |
| 1832 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1833 | |
| 1834 | LayerTestResult<uint8_t, 4> StridedSlice4DUint8Test( |
| 1835 | armnn::IWorkloadFactory& workloadFactory, |
| 1836 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1837 | |
| 1838 | LayerTestResult<uint8_t, 4> StridedSlice4DReverseUint8Test( |
| 1839 | armnn::IWorkloadFactory& workloadFactory, |
| 1840 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1841 | |
| 1842 | LayerTestResult<uint8_t, 4> StridedSliceSimpleStrideUint8Test( |
| 1843 | armnn::IWorkloadFactory& workloadFactory, |
| 1844 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1845 | |
| 1846 | LayerTestResult<uint8_t, 4> StridedSliceSimpleRangeMaskUint8Test( |
| 1847 | armnn::IWorkloadFactory& workloadFactory, |
| 1848 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1849 | |
| 1850 | LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskUint8Test( |
| 1851 | armnn::IWorkloadFactory& workloadFactory, |
| 1852 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1853 | |
| 1854 | LayerTestResult<uint8_t, 3> StridedSlice3DUint8Test( |
| 1855 | armnn::IWorkloadFactory& workloadFactory, |
| 1856 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1857 | |
| 1858 | LayerTestResult<uint8_t, 3> StridedSlice3DReverseUint8Test( |
| 1859 | armnn::IWorkloadFactory& workloadFactory, |
| 1860 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1861 | |
| 1862 | LayerTestResult<uint8_t, 2> StridedSlice2DUint8Test( |
| 1863 | armnn::IWorkloadFactory& workloadFactory, |
| 1864 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1865 | |
| 1866 | LayerTestResult<uint8_t, 2> StridedSlice2DReverseUint8Test( |
| 1867 | armnn::IWorkloadFactory& workloadFactory, |
| 1868 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 1869 | |
Matteo Martincigh | 42666a1 | 2019-05-29 08:53:41 +0100 | [diff] [blame] | 1870 | LayerTestResult<int16_t, 4> StridedSlice4DInt16Test( |
| 1871 | armnn::IWorkloadFactory& workloadFactory, |
| 1872 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1873 | |
| 1874 | LayerTestResult<int16_t, 4> StridedSlice4DReverseInt16Test( |
| 1875 | armnn::IWorkloadFactory& workloadFactory, |
| 1876 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1877 | |
| 1878 | LayerTestResult<int16_t, 4> StridedSliceSimpleStrideInt16Test( |
| 1879 | armnn::IWorkloadFactory& workloadFactory, |
| 1880 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1881 | |
| 1882 | LayerTestResult<int16_t, 4> StridedSliceSimpleRangeMaskInt16Test( |
| 1883 | armnn::IWorkloadFactory& workloadFactory, |
| 1884 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1885 | |
| 1886 | LayerTestResult<int16_t, 2> StridedSliceShrinkAxisMaskInt16Test( |
| 1887 | armnn::IWorkloadFactory& workloadFactory, |
| 1888 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1889 | |
| 1890 | LayerTestResult<int16_t, 3> StridedSlice3DInt16Test( |
| 1891 | armnn::IWorkloadFactory& workloadFactory, |
| 1892 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1893 | |
| 1894 | LayerTestResult<int16_t, 3> StridedSlice3DReverseInt16Test( |
| 1895 | armnn::IWorkloadFactory& workloadFactory, |
| 1896 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1897 | |
| 1898 | LayerTestResult<int16_t, 2> StridedSlice2DInt16Test( |
| 1899 | armnn::IWorkloadFactory& workloadFactory, |
| 1900 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1901 | |
| 1902 | LayerTestResult<int16_t, 2> StridedSlice2DReverseInt16Test( |
| 1903 | armnn::IWorkloadFactory& workloadFactory, |
| 1904 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1905 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 1906 | LayerTestResult<float, 4> Debug4DFloat32Test( |
| 1907 | armnn::IWorkloadFactory& workloadFactory, |
| 1908 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1909 | |
| 1910 | LayerTestResult<float, 3> Debug3DFloat32Test( |
| 1911 | armnn::IWorkloadFactory& workloadFactory, |
| 1912 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1913 | |
| 1914 | LayerTestResult<float, 2> Debug2DFloat32Test( |
| 1915 | armnn::IWorkloadFactory& workloadFactory, |
| 1916 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1917 | |
| 1918 | LayerTestResult<float, 1> Debug1DFloat32Test( |
| 1919 | armnn::IWorkloadFactory& workloadFactory, |
| 1920 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1921 | |
| 1922 | LayerTestResult<uint8_t, 4> Debug4DUint8Test( |
| 1923 | armnn::IWorkloadFactory& workloadFactory, |
| 1924 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1925 | |
| 1926 | LayerTestResult<uint8_t, 3> Debug3DUint8Test( |
| 1927 | armnn::IWorkloadFactory& workloadFactory, |
| 1928 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1929 | |
| 1930 | LayerTestResult<uint8_t, 2> Debug2DUint8Test( |
| 1931 | armnn::IWorkloadFactory& workloadFactory, |
| 1932 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1933 | |
| 1934 | LayerTestResult<uint8_t, 1> Debug1DUint8Test( |
| 1935 | armnn::IWorkloadFactory& workloadFactory, |
| 1936 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 1937 | |
| 1938 | LayerTestResult<uint8_t, 4> PreCompiledConvolution2dTest( |
| 1939 | armnn::IWorkloadFactory& workloadFactory, |
| 1940 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1941 | |
| 1942 | LayerTestResult<uint8_t, 4> PreCompiledConvolution2dStride2x2Test( |
| 1943 | armnn::IWorkloadFactory& workloadFactory, |
| 1944 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1945 | |
| 1946 | LayerTestResult<uint8_t, 4> PreCompiledDepthwiseConvolution2dTest( |
| 1947 | armnn::IWorkloadFactory & workloadFactory, |
| 1948 | const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager); |
| 1949 | |
| 1950 | LayerTestResult<uint8_t, 4> PreCompiledDepthwiseConvolution2dStride2x2Test( |
| 1951 | armnn::IWorkloadFactory & workloadFactory, |
| 1952 | const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager); |
| 1953 | |
| 1954 | LayerTestResult<uint8_t, 4> PreCompiledMaxPooling2dTest( |
| 1955 | armnn::IWorkloadFactory& workloadFactory, |
| 1956 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1957 | |
| 1958 | LayerTestResult<float, 4> Debug4DFloat32Test( |
| 1959 | armnn::IWorkloadFactory& workloadFactory, |
| 1960 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1961 | |
| 1962 | LayerTestResult<float, 3> Debug3DFloat32Test( |
| 1963 | armnn::IWorkloadFactory& workloadFactory, |
| 1964 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1965 | |
| 1966 | LayerTestResult<float, 2> Debug2DFloat32Test( |
| 1967 | armnn::IWorkloadFactory& workloadFactory, |
| 1968 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1969 | |
| 1970 | LayerTestResult<float, 1> Debug1DFloat32Test( |
| 1971 | armnn::IWorkloadFactory& workloadFactory, |
| 1972 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1973 | |
| 1974 | LayerTestResult<uint8_t, 4> Debug4DUint8Test( |
| 1975 | armnn::IWorkloadFactory& workloadFactory, |
| 1976 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1977 | |
| 1978 | LayerTestResult<uint8_t, 3> Debug3DUint8Test( |
| 1979 | armnn::IWorkloadFactory& workloadFactory, |
| 1980 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1981 | |
| 1982 | LayerTestResult<uint8_t, 2> Debug2DUint8Test( |
| 1983 | armnn::IWorkloadFactory& workloadFactory, |
| 1984 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1985 | |
| 1986 | LayerTestResult<uint8_t, 1> Debug1DUint8Test( |
| 1987 | armnn::IWorkloadFactory& workloadFactory, |
| 1988 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
narpra01 | 4951d84 | 2019-01-18 16:53:53 +0000 | [diff] [blame] | 1989 | |
| 1990 | LayerTestResult<float, 1> Gather1DParamsFloatTest( |
| 1991 | armnn::IWorkloadFactory& workloadFactory, |
| 1992 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1993 | |
| 1994 | LayerTestResult<uint8_t, 1> Gather1DParamsUint8Test( |
| 1995 | armnn::IWorkloadFactory& workloadFactory, |
| 1996 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 1997 | |
Ellen Norris-Thompson | e0dbedf | 2019-06-24 09:23:38 +0100 | [diff] [blame] | 1998 | LayerTestResult<int16_t, 1> Gather1DParamsInt16Test( |
| 1999 | armnn::IWorkloadFactory& workloadFactory, |
| 2000 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2001 | |
narpra01 | 4951d84 | 2019-01-18 16:53:53 +0000 | [diff] [blame] | 2002 | LayerTestResult<float, 2> GatherMultiDimParamsFloatTest( |
| 2003 | armnn::IWorkloadFactory& workloadFactory, |
| 2004 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2005 | |
| 2006 | LayerTestResult<uint8_t, 2> GatherMultiDimParamsUint8Test( |
| 2007 | armnn::IWorkloadFactory& workloadFactory, |
| 2008 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2009 | |
Ellen Norris-Thompson | e0dbedf | 2019-06-24 09:23:38 +0100 | [diff] [blame] | 2010 | LayerTestResult<int16_t, 2> GatherMultiDimParamsInt16Test( |
| 2011 | armnn::IWorkloadFactory& workloadFactory, |
| 2012 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2013 | |
narpra01 | 4951d84 | 2019-01-18 16:53:53 +0000 | [diff] [blame] | 2014 | LayerTestResult<float, 4> GatherMultiDimParamsMultiDimIndicesFloatTest( |
| 2015 | armnn::IWorkloadFactory& workloadFactory, |
| 2016 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2017 | |
| 2018 | LayerTestResult<uint8_t, 4> GatherMultiDimParamsMultiDimIndicesUint8Test( |
| 2019 | armnn::IWorkloadFactory& workloadFactory, |
| 2020 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | 8a54ac0 | 2019-03-29 15:25:04 +0000 | [diff] [blame] | 2021 | |
Ellen Norris-Thompson | e0dbedf | 2019-06-24 09:23:38 +0100 | [diff] [blame] | 2022 | LayerTestResult<int16_t, 4> GatherMultiDimParamsMultiDimIndicesInt16Test( |
| 2023 | armnn::IWorkloadFactory& workloadFactory, |
| 2024 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2025 | |
Nattapat Chaimanowong | afa4e3a | 2019-04-02 11:41:45 +0100 | [diff] [blame] | 2026 | LayerTestResult<float, 4> DequantizeSimpleUint8Test( |
| 2027 | armnn::IWorkloadFactory& workloadFactory, |
| 2028 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2029 | |
| 2030 | LayerTestResult<float, 4> DequantizeOffsetUint8Test( |
| 2031 | armnn::IWorkloadFactory& workloadFactory, |
| 2032 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2033 | |
| 2034 | LayerTestResult<float, 4> DequantizeSimpleInt16Test( |
Nattapat Chaimanowong | 8a54ac0 | 2019-03-29 15:25:04 +0000 | [diff] [blame] | 2035 | armnn::IWorkloadFactory& workloadFactory, |
| 2036 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Nattapat Chaimanowong | a0beb3b | 2019-04-01 17:04:53 +0100 | [diff] [blame] | 2037 | |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 2038 | LayerTestResult<uint8_t, 4> SpaceToDepthNCHWAsymmQ8Test( |
| 2039 | armnn::IWorkloadFactory& workloadFactory, |
| 2040 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2041 | |
| 2042 | LayerTestResult<uint8_t, 4> SpaceToDepthNHWCAsymmQ8Test( |
| 2043 | armnn::IWorkloadFactory& workloadFactory, |
| 2044 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2045 | |
James Conroy | d2aa85e | 2019-07-01 17:12:40 +0100 | [diff] [blame] | 2046 | LayerTestResult<float, 4> SpaceToDepthNHWCFloat32Test1( |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 2047 | armnn::IWorkloadFactory& workloadFactory, |
| 2048 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2049 | |
James Conroy | d2aa85e | 2019-07-01 17:12:40 +0100 | [diff] [blame] | 2050 | LayerTestResult<float, 4> SpaceToDepthNCHWFloat32Test1( |
| 2051 | armnn::IWorkloadFactory& workloadFactory, |
| 2052 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2053 | |
| 2054 | LayerTestResult<float, 4> SpaceToDepthNHWCFloat32Test2( |
| 2055 | armnn::IWorkloadFactory& workloadFactory, |
| 2056 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2057 | |
| 2058 | LayerTestResult<float, 4> SpaceToDepthNCHWFloat32Test2( |
| 2059 | armnn::IWorkloadFactory& workloadFactory, |
| 2060 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2061 | |
| 2062 | LayerTestResult<int16_t, 4> SpaceToDepthNHWCQSymm16Test( |
| 2063 | armnn::IWorkloadFactory& workloadFactory, |
| 2064 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2065 | |
| 2066 | LayerTestResult<int16_t, 4> SpaceToDepthNCHWQSymm16Test( |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 2067 | armnn::IWorkloadFactory& workloadFactory, |
| 2068 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2069 | |
Nattapat Chaimanowong | a0beb3b | 2019-04-01 17:04:53 +0100 | [diff] [blame] | 2070 | LayerTestResult<uint8_t, 4> QuantizeSimpleUint8Test( |
| 2071 | armnn::IWorkloadFactory& workloadFactory, |
| 2072 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2073 | |
| 2074 | LayerTestResult<uint8_t, 4> QuantizeClampUint8Test( |
| 2075 | armnn::IWorkloadFactory& workloadFactory, |
| 2076 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 2077 | |
| 2078 | LayerTestResult<int16_t, 4> QuantizeClampInt16Test( |
| 2079 | armnn::IWorkloadFactory& workloadFactory, |
| 2080 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 2081 | |
| 2082 | template<typename T, typename B> |
| 2083 | LayerTestResult<T, 2> SimpleFullyConnectedTestImpl( |
| 2084 | armnn::IWorkloadFactory& workloadFactory, |
| 2085 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2086 | armnn::TensorInfo inputTensorInfo, |
| 2087 | armnn::TensorInfo outputTensorInfo, |
| 2088 | armnn::TensorInfo weightsDesc, |
| 2089 | armnn::TensorInfo biasesDesc, |
| 2090 | boost::multi_array<T, 2>& weights, |
| 2091 | boost::multi_array<B, 1>& bias, |
| 2092 | boost::multi_array<T, 4>& input, |
| 2093 | bool biasEnabled, |
| 2094 | bool transposeWeights) |
| 2095 | { |
| 2096 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2097 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2098 | |
| 2099 | armnn::FullyConnectedQueueDescriptor data; |
| 2100 | armnn::WorkloadInfo info; |
| 2101 | armnn::ScopedCpuTensorHandle weightsTensor(weightsDesc); |
| 2102 | armnn::ScopedCpuTensorHandle biasTensor(biasesDesc); |
| 2103 | |
| 2104 | AllocateAndCopyDataToITensorHandle(&weightsTensor, &weights[0][0]); |
| 2105 | AllocateAndCopyDataToITensorHandle(&biasTensor, &bias[0]); |
| 2106 | |
| 2107 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 2108 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 2109 | data.m_Weight = &weightsTensor; |
| 2110 | data.m_Bias = &biasTensor; |
| 2111 | data.m_Parameters.m_BiasEnabled = biasEnabled; |
| 2112 | data.m_Parameters.m_TransposeWeightMatrix = transposeWeights; |
| 2113 | |
| 2114 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateFullyConnected(data, info); |
| 2115 | LayerTestResult<T, 2> result(outputTensorInfo); |
| 2116 | |
| 2117 | inputHandle->Allocate(); |
| 2118 | outputHandle->Allocate(); |
| 2119 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2120 | |
| 2121 | ExecuteWorkload(*workload, memoryManager); |
| 2122 | |
| 2123 | CopyDataFromITensorHandle(&result.output[0][0], outputHandle.get()); |
| 2124 | |
| 2125 | return result; |
| 2126 | } |
| 2127 | |
| 2128 | template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 2129 | std::vector<T> ConvertToDataType(const std::vector<float>& input, |
| 2130 | const armnn::TensorInfo& inputTensorInfo) |
| 2131 | { |
| 2132 | std::vector<T> output(input.size()); |
| 2133 | auto outputTensorInfo = inputTensorInfo; |
| 2134 | outputTensorInfo.SetDataType(ArmnnType); |
| 2135 | |
| 2136 | std::unique_ptr<armnn::Encoder<float>> pOutputEncoder = armnn::MakeEncoder<float>(outputTensorInfo, output.data()); |
| 2137 | armnn::Encoder<float>& rOutputEncoder = *pOutputEncoder; |
| 2138 | |
| 2139 | for (auto it = input.begin(); it != input.end(); ++it) |
| 2140 | { |
| 2141 | rOutputEncoder.Set(*it); |
| 2142 | ++rOutputEncoder; |
| 2143 | } |
| 2144 | return output; |
| 2145 | } |
| 2146 | |
David Monahan | 3475781 | 2019-06-19 11:47:21 +0100 | [diff] [blame] | 2147 | // Utility method to convert a single value to the correct type |
| 2148 | template <typename T> |
| 2149 | T ConvertToDataType(const float& value, |
| 2150 | const armnn::TensorInfo& tensorInfo) |
| 2151 | { |
| 2152 | std::vector<T> output(1); |
| 2153 | std::unique_ptr<armnn::Encoder<float>> pEncoder = armnn::MakeEncoder<float>(tensorInfo, output.data()); |
| 2154 | armnn::Encoder<float>& rEncoder = *pEncoder; |
| 2155 | rEncoder.Set(value); |
| 2156 | return output[0]; |
| 2157 | } |
| 2158 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2159 | template<armnn::DataType ArmnnType, typename T> |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2160 | LayerTestResult<T, 2> Rsqrt2dTestCommon( |
| 2161 | armnn::IWorkloadFactory& workloadFactory, |
| 2162 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2163 | const armnn::TensorInfo inputTensorInfo, |
| 2164 | const armnn::TensorInfo outputTensorInfo, |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2165 | const std::vector<float>& inputValues, |
| 2166 | const std::vector<float>& expectedOutputValues) |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2167 | { |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2168 | auto inputTensor = MakeTensor<T, 2>(inputTensorInfo, ConvertToDataType<ArmnnType>(inputValues,inputTensorInfo)); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2169 | |
| 2170 | LayerTestResult<T, 2> result(outputTensorInfo); |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2171 | |
| 2172 | result.outputExpected = MakeTensor<T, 2>(outputTensorInfo, |
| 2173 | ConvertToDataType<ArmnnType>(expectedOutputValues,outputTensorInfo)); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2174 | |
| 2175 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2176 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2177 | |
| 2178 | armnn::RsqrtQueueDescriptor descriptor; |
| 2179 | |
| 2180 | armnn::WorkloadInfo info; |
| 2181 | |
| 2182 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2183 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2184 | |
| 2185 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateRsqrt(descriptor, info); |
| 2186 | |
| 2187 | inputHandle->Allocate(); |
| 2188 | outputHandle->Allocate(); |
| 2189 | |
| 2190 | CopyDataToITensorHandle(inputHandle.get(), &inputTensor[0][0]); |
| 2191 | |
| 2192 | workload->PostAllocationConfigure(); |
| 2193 | workload->Execute(); |
| 2194 | |
| 2195 | CopyDataFromITensorHandle(&result.output[0][0], outputHandle.get()); |
| 2196 | |
| 2197 | return result; |
| 2198 | } |
| 2199 | |
| 2200 | template<armnn::DataType ArmnnType, typename T> |
| 2201 | LayerTestResult<T, 2> Rsqrt2dTest( |
| 2202 | armnn::IWorkloadFactory& workloadFactory, |
| 2203 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2204 | { |
| 2205 | const armnn::TensorShape inputShape{ 2, 2 }; |
| 2206 | const armnn::TensorShape outputShape{ 2, 2 }; |
| 2207 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2208 | armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType); |
| 2209 | inputTensorInfo.SetQuantizationScale(0.1f); |
| 2210 | inputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2211 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2212 | armnn::TensorInfo outputTensorInfo(outputShape, ArmnnType); |
| 2213 | outputTensorInfo.SetQuantizationScale(0.1f); |
| 2214 | outputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2215 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2216 | std::vector<float> inputValues |
| 2217 | { |
| 2218 | 1.f, 4.f, |
| 2219 | 16.f, 25.f |
| 2220 | }; |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2221 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2222 | std::vector<float> expectedOutputValues |
| 2223 | { |
| 2224 | 1.f, 0.5f, |
| 2225 | 0.25f, 0.2f |
| 2226 | }; |
| 2227 | |
| 2228 | return Rsqrt2dTestCommon<ArmnnType>(workloadFactory, memoryManager, |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2229 | inputTensorInfo, outputTensorInfo, |
| 2230 | inputValues, expectedOutputValues); |
| 2231 | } |
| 2232 | |
| 2233 | template<armnn::DataType ArmnnType, typename T> |
| 2234 | LayerTestResult<T, 3> Rsqrt3dTest( |
| 2235 | armnn::IWorkloadFactory& workloadFactory, |
| 2236 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2237 | { |
| 2238 | const armnn::TensorShape inputShape{ 3, 1, 2 }; |
| 2239 | const armnn::TensorShape outputShape{ 3, 1, 2 }; |
| 2240 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2241 | armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType); |
| 2242 | inputTensorInfo.SetQuantizationScale(0.1f); |
| 2243 | inputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2244 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2245 | armnn::TensorInfo outputTensorInfo(outputShape, ArmnnType); |
| 2246 | outputTensorInfo.SetQuantizationScale(0.1f); |
| 2247 | outputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2248 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2249 | std::vector<float> inputValues |
| 2250 | { |
| 2251 | 1.f, 4.f, 16.f, |
| 2252 | 25.f, 64.f, 100.f |
| 2253 | }; |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2254 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2255 | std::vector<float> expectedOutputValues |
| 2256 | { |
| 2257 | 1.f, 0.5f, 0.25f, |
| 2258 | 0.2f, 0.125f, 0.1f |
| 2259 | }; |
| 2260 | |
| 2261 | auto inputTensor = MakeTensor<T, 3>(inputTensorInfo, ConvertToDataType<ArmnnType>(inputValues,inputTensorInfo)); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2262 | |
| 2263 | LayerTestResult<T, 3> result(outputTensorInfo); |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2264 | result.outputExpected = MakeTensor<T, 3>(outputTensorInfo, |
| 2265 | ConvertToDataType<ArmnnType>(expectedOutputValues,outputTensorInfo)); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2266 | |
| 2267 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2268 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2269 | |
| 2270 | armnn::RsqrtQueueDescriptor descriptor; |
| 2271 | |
| 2272 | armnn::WorkloadInfo info; |
| 2273 | |
| 2274 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2275 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2276 | |
| 2277 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateRsqrt(descriptor, info); |
| 2278 | |
| 2279 | inputHandle->Allocate(); |
| 2280 | outputHandle->Allocate(); |
| 2281 | |
| 2282 | CopyDataToITensorHandle(inputHandle.get(), &inputTensor[0][0][0]); |
| 2283 | |
| 2284 | workload->PostAllocationConfigure(); |
| 2285 | workload->Execute(); |
| 2286 | |
| 2287 | CopyDataFromITensorHandle(&result.output[0][0][0], outputHandle.get()); |
| 2288 | |
| 2289 | return result; |
| 2290 | } |
| 2291 | |
| 2292 | template<armnn::DataType ArmnnType, typename T> |
| 2293 | LayerTestResult<T, 2> RsqrtZeroTest( |
| 2294 | armnn::IWorkloadFactory& workloadFactory, |
| 2295 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2296 | { |
| 2297 | const armnn::TensorShape inputShape{ 1, 2 }; |
| 2298 | const armnn::TensorShape outputShape{ 1, 2 }; |
| 2299 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2300 | armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType); |
| 2301 | inputTensorInfo.SetQuantizationScale(0.1f); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2302 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2303 | armnn::TensorInfo outputTensorInfo(outputShape, ArmnnType); |
| 2304 | outputTensorInfo.SetQuantizationScale(0.1f); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2305 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2306 | std::vector<float> inputValues |
| 2307 | { |
| 2308 | 0.f, -0.f |
| 2309 | }; |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2310 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2311 | std::vector<float> expectedOutputValues |
| 2312 | { |
| 2313 | INFINITY, -INFINITY |
| 2314 | }; |
| 2315 | |
| 2316 | return Rsqrt2dTestCommon<ArmnnType>(workloadFactory, memoryManager, |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2317 | inputTensorInfo, outputTensorInfo, |
| 2318 | inputValues, expectedOutputValues); |
| 2319 | } |
| 2320 | |
| 2321 | template<armnn::DataType ArmnnType, typename T> |
| 2322 | LayerTestResult<T, 2> RsqrtNegativeTest( |
| 2323 | armnn::IWorkloadFactory& workloadFactory, |
| 2324 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2325 | { |
| 2326 | const armnn::TensorShape inputShape{ 1, 2 }; |
| 2327 | const armnn::TensorShape outputShape{ 1, 2 }; |
| 2328 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2329 | armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType); |
| 2330 | inputTensorInfo.SetQuantizationScale(0.1f); |
| 2331 | inputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2332 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2333 | armnn::TensorInfo outputTensorInfo(outputShape, ArmnnType); |
| 2334 | outputTensorInfo.SetQuantizationScale(0.1f); |
| 2335 | outputTensorInfo.SetQuantizationOffset(0); |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2336 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2337 | std::vector<float> inputValues |
| 2338 | { |
| 2339 | -25.f, -16.f |
| 2340 | }; |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2341 | |
nikraj01 | 0421e7f | 2019-06-14 09:40:34 +0100 | [diff] [blame] | 2342 | std::vector<float> expectedOutputValues |
| 2343 | { |
| 2344 | -NAN, -NAN |
| 2345 | }; |
| 2346 | |
| 2347 | return Rsqrt2dTestCommon<ArmnnType>(workloadFactory, memoryManager, |
nikraj01 | 93f84a9 | 2019-06-05 10:48:46 +0100 | [diff] [blame] | 2348 | inputTensorInfo, outputTensorInfo, |
| 2349 | inputValues, expectedOutputValues); |
| 2350 | } |
| 2351 | |
| 2352 | template<typename T> |
Nina Drozd | 8ed4b8c | 2019-05-29 10:41:04 +0100 | [diff] [blame] | 2353 | LayerTestResult<T, 4> SimpleReshapeTestImpl( |
| 2354 | armnn::IWorkloadFactory& workloadFactory, |
| 2355 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2356 | armnn::TensorInfo inputTensorInfo, |
| 2357 | armnn::TensorInfo outputTensorInfo, |
| 2358 | const std::vector<T>& inputData, |
| 2359 | const std::vector<T>& outputExpectedData) |
| 2360 | { |
| 2361 | auto input = MakeTensor<T, 4>(inputTensorInfo, inputData); |
| 2362 | |
| 2363 | LayerTestResult<T, 4> ret(outputTensorInfo); |
| 2364 | ret.outputExpected = MakeTensor<T, 4>(outputTensorInfo, outputExpectedData); |
| 2365 | |
| 2366 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2367 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2368 | |
| 2369 | armnn::ReshapeQueueDescriptor data; |
| 2370 | armnn::WorkloadInfo info; |
| 2371 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 2372 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 2373 | |
| 2374 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateReshape(data, info); |
| 2375 | |
| 2376 | inputHandle->Allocate(); |
| 2377 | outputHandle->Allocate(); |
| 2378 | |
| 2379 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2380 | |
| 2381 | workload->Execute(); |
| 2382 | |
| 2383 | CopyDataFromITensorHandle(&ret.output[0][0][0][0], outputHandle.get()); |
| 2384 | |
| 2385 | return ret; |
| 2386 | } |
| 2387 | |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 2388 | template<armnn::DataType ArmnnType, typename T> |
| 2389 | LayerTestResult<T, 2> FullyConnectedTest( |
| 2390 | armnn::IWorkloadFactory& workloadFactory, |
| 2391 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2392 | bool biasEnabled) |
| 2393 | { |
| 2394 | constexpr static unsigned int inputWidth = 3u; |
| 2395 | constexpr static unsigned int inputHeight = 2u; |
| 2396 | constexpr static unsigned int inputChannels = 1u; |
| 2397 | |
| 2398 | constexpr static unsigned int inputSize = inputWidth * inputHeight * inputChannels; |
| 2399 | |
| 2400 | constexpr static unsigned int outputChannels = 2u; |
| 2401 | |
| 2402 | armnn::TensorInfo inputTensorInfo({ 1, inputChannels, inputHeight, inputWidth }, ArmnnType); |
| 2403 | inputTensorInfo.SetQuantizationScale(0.1f); |
| 2404 | inputTensorInfo.SetQuantizationOffset(63); |
| 2405 | |
| 2406 | armnn::TensorInfo outputTensorInfo({ 1, outputChannels }, ArmnnType); |
| 2407 | outputTensorInfo.SetQuantizationScale(5.f); |
| 2408 | outputTensorInfo.SetQuantizationOffset(biasEnabled ? -50 : 10); |
| 2409 | |
| 2410 | armnn::TensorInfo weightsDesc({ outputChannels, inputSize }, ArmnnType); |
| 2411 | weightsDesc.SetQuantizationScale(0.2f); |
| 2412 | weightsDesc.SetQuantizationOffset(93); |
| 2413 | |
| 2414 | armnn::TensorInfo biasesDesc({ outputChannels }, GetBiasTypeFromWeightsType(weightsDesc.GetDataType()).value()); |
| 2415 | biasesDesc.SetQuantizationScale(inputTensorInfo.GetQuantizationScale() * weightsDesc.GetQuantizationScale()); |
| 2416 | biasesDesc.SetQuantizationOffset(0); |
| 2417 | |
| 2418 | LayerTestResult<T, 2> result(outputTensorInfo); |
| 2419 | |
| 2420 | auto input = MakeTensor<T, 4>(inputTensorInfo, ConvertToDataType<ArmnnType>( |
| 2421 | { |
| 2422 | -1.2f, 6.1f, -3.5f, |
| 2423 | 18.8f, -5.5f, 2.9f |
| 2424 | }, |
| 2425 | inputTensorInfo)); |
| 2426 | |
| 2427 | auto weights = MakeTensor<T, 2>(weightsDesc, ConvertToDataType<ArmnnType>( |
| 2428 | { |
| 2429 | -8.4f, 20.0f, -10.4f, -8, 16.4f, -11.8f, |
| 2430 | 23.4f, 10.4f, -14.0f, -3.8f, -11.8f, 11.4f |
| 2431 | }, |
| 2432 | weightsDesc)); |
| 2433 | |
| 2434 | auto bias = MakeTensor<int32_t, 1>(biasesDesc, std::vector<int32_t>{9250, 67500}); |
| 2435 | |
| 2436 | result = SimpleFullyConnectedTestImpl<T>( |
| 2437 | workloadFactory, |
| 2438 | memoryManager, |
| 2439 | inputTensorInfo, outputTensorInfo, |
| 2440 | weightsDesc, biasesDesc, |
| 2441 | weights, bias, input, |
| 2442 | biasEnabled, true |
| 2443 | ); |
| 2444 | |
| 2445 | if (biasEnabled) |
| 2446 | { |
| 2447 | result.outputExpected = MakeTensor<T, 2>(outputTensorInfo, |
| 2448 | ConvertToDataType<ArmnnType>({80.f, 1460.f}, outputTensorInfo)); |
| 2449 | } |
| 2450 | else |
| 2451 | { |
| 2452 | result.outputExpected = MakeTensor<T, 2>(outputTensorInfo, |
| 2453 | ConvertToDataType<ArmnnType>({-107.04f, 110.f}, outputTensorInfo)); |
| 2454 | } |
| 2455 | |
| 2456 | return result; |
Nina Drozd | 8ed4b8c | 2019-05-29 10:41:04 +0100 | [diff] [blame] | 2457 | } |
| 2458 | |
Nina Drozd | 8ed4b8c | 2019-05-29 10:41:04 +0100 | [diff] [blame] | 2459 | template<armnn::DataType ArmnnType, typename T> |
| 2460 | LayerTestResult<T, 4> SimpleReshapeTest( |
| 2461 | armnn::IWorkloadFactory& workloadFactory, |
| 2462 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2463 | { |
| 2464 | armnn::TensorInfo inputTensorInfo; |
| 2465 | armnn::TensorInfo outputTensorInfo; |
| 2466 | |
| 2467 | unsigned int inputShape[] = { 2, 2, 3, 3 }; |
| 2468 | unsigned int outputShape[] = { 2, 2, 9, 1 }; |
| 2469 | |
| 2470 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 2471 | inputTensorInfo.SetQuantizationScale(1.0f); |
| 2472 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
| 2473 | outputTensorInfo.SetQuantizationScale(1.0f); |
| 2474 | |
| 2475 | auto input = ConvertToDataType<ArmnnType>( |
| 2476 | { |
| 2477 | 0.0f, 1.0f, 2.0f, |
| 2478 | 3.0f, 4.0f, 5.0f, |
| 2479 | 6.0f, 7.0f, 8.0f, |
| 2480 | |
| 2481 | 9.0f, 10.0f, 11.0f, |
| 2482 | 12.0f, 13.0f, 14.0f, |
| 2483 | 15.0f, 16.0f, 17.0f, |
| 2484 | |
| 2485 | 18.0f, 19.0f, 20.0f, |
| 2486 | 21.0f, 22.0f, 23.0f, |
| 2487 | 24.0f, 25.0f, 26.0f, |
| 2488 | |
| 2489 | 27.0f, 28.0f, 29.0f, |
| 2490 | 30.0f, 31.0f, 32.0f, |
| 2491 | 33.0f, 34.0f, 35.0f, |
| 2492 | }, |
| 2493 | inputTensorInfo); |
| 2494 | |
| 2495 | auto outputExpected = ConvertToDataType<ArmnnType>( |
| 2496 | { |
| 2497 | 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, |
| 2498 | |
| 2499 | 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, |
| 2500 | |
| 2501 | 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, |
| 2502 | |
| 2503 | 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, |
| 2504 | }, |
| 2505 | outputTensorInfo); |
| 2506 | |
| 2507 | return SimpleReshapeTestImpl<T>( |
| 2508 | workloadFactory, memoryManager, inputTensorInfo, outputTensorInfo, input, outputExpected); |
Matteo Martincigh | 42666a1 | 2019-05-29 08:53:41 +0100 | [diff] [blame] | 2509 | } |
James Conroy | 83735b1 | 2019-05-30 16:36:59 +0100 | [diff] [blame] | 2510 | |
| 2511 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 2512 | LayerTestResult<T, 4> SimpleFloorTest( |
| 2513 | armnn::IWorkloadFactory& workloadFactory, |
| 2514 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 2515 | { |
James Conroy | b40d710 | 2019-06-04 12:32:09 +0100 | [diff] [blame] | 2516 | armnn::TensorInfo inputTensorInfo({1, 3, 2, 3}, ArmnnType); |
| 2517 | inputTensorInfo.SetQuantizationScale(0.1f); |
| 2518 | |
| 2519 | armnn::TensorInfo outputTensorInfo(inputTensorInfo); |
| 2520 | outputTensorInfo.SetQuantizationScale(0.1f); |
James Conroy | 83735b1 | 2019-05-30 16:36:59 +0100 | [diff] [blame] | 2521 | |
| 2522 | auto input = MakeTensor<T, 4>(inputTensorInfo, ConvertToDataType<ArmnnType>( |
| 2523 | { -37.5f, -15.2f, -8.76f, -2.0f, -1.5f, -1.3f, -0.5f, -0.4f, 0.0f, |
| 2524 | 1.0f, 0.4f, 0.5f, 1.3f, 1.5f, 2.0f, 8.76f, 15.2f, 37.5f }, |
| 2525 | inputTensorInfo)); |
| 2526 | |
| 2527 | LayerTestResult<T, 4> ret(outputTensorInfo); |
| 2528 | ret.outputExpected = MakeTensor<T, 4>(outputTensorInfo, ConvertToDataType<ArmnnType>( |
| 2529 | { -38.0f, -16.0f, -9.0f, -2.0f, -2.0f, -2.0f, -1.0f, -1.0f, 0.0f, |
| 2530 | 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 2.0f, 8.0f, 15.0f, 37.0f }, |
| 2531 | outputTensorInfo)); |
| 2532 | |
| 2533 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2534 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2535 | |
| 2536 | armnn::FloorQueueDescriptor data; |
| 2537 | armnn::WorkloadInfo info; |
| 2538 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 2539 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 2540 | |
| 2541 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateFloor(data, info); |
| 2542 | |
| 2543 | inputHandle->Allocate(); |
| 2544 | outputHandle->Allocate(); |
| 2545 | |
| 2546 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2547 | |
| 2548 | workload->Execute(); |
| 2549 | |
| 2550 | CopyDataFromITensorHandle(&ret.output[0][0][0][0], outputHandle.get()); |
| 2551 | |
| 2552 | return ret; |
Matteo Martincigh | f550713 | 2019-06-04 10:59:47 +0100 | [diff] [blame] | 2553 | } |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2554 | |
| 2555 | |
| 2556 | template<armnn::DataType ArmnnType, typename T> |
| 2557 | LayerTestResult<T, 4> ResizeBilinearNopTest( |
| 2558 | armnn::IWorkloadFactory& workloadFactory, |
| 2559 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2560 | const armnn::DataLayout dataLayout) |
| 2561 | { |
| 2562 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 2563 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 2564 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 2565 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 2566 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 2567 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 2568 | if (armnn::IsQuantizedType<T>()) |
| 2569 | { |
| 2570 | inputTensorInfo.SetQuantizationScale(1.5f); |
| 2571 | inputTensorInfo.SetQuantizationOffset(-3); |
| 2572 | outputTensorInfo.SetQuantizationScale(1.5f); |
| 2573 | outputTensorInfo.SetQuantizationOffset(-3); |
| 2574 | } |
| 2575 | |
| 2576 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 2577 | ? std::initializer_list<float> |
| 2578 | { |
| 2579 | 1, 2, 3, 4, |
| 2580 | 2, 3, 4, 5, |
| 2581 | 3, 4, 5, 6, |
| 2582 | 4, 5, 6, 7 |
| 2583 | } |
| 2584 | : std::initializer_list<float> |
| 2585 | { |
| 2586 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 2587 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 2588 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 2589 | 4.0f, 5.0f, 6.0f, 7.0f, |
| 2590 | |
| 2591 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 2592 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 2593 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 2594 | 4.0f, 5.0f, 6.0f, 7.0f |
| 2595 | }; |
| 2596 | |
| 2597 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 2598 | if (dataLayout == armnn::DataLayout::NHWC) |
| 2599 | { |
| 2600 | std::vector<float> tmp(inputData.size()); |
| 2601 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 2602 | inputData = tmp; |
| 2603 | } |
| 2604 | |
| 2605 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 2606 | inputTensorInfo.GetQuantizationOffset(), |
| 2607 | inputData)); |
| 2608 | |
| 2609 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 2610 | result.outputExpected = input; |
| 2611 | |
| 2612 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2613 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2614 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2615 | armnn::ResizeQueueDescriptor descriptor; |
| 2616 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::Bilinear; |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2617 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2618 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2619 | armnn::WorkloadInfo info; |
| 2620 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2621 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2622 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2623 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2624 | |
| 2625 | inputHandle->Allocate(); |
| 2626 | outputHandle->Allocate(); |
| 2627 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2628 | |
| 2629 | workload->PostAllocationConfigure(); |
| 2630 | workload->Execute(); |
| 2631 | |
| 2632 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 2633 | return result; |
| 2634 | } |
| 2635 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2636 | template<armnn::DataType ArmnnType, typename T> |
| 2637 | LayerTestResult<T, 4> SimpleResizeBilinearTest( |
| 2638 | armnn::IWorkloadFactory& workloadFactory, |
| 2639 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2640 | const armnn::DataLayout dataLayout) |
| 2641 | { |
| 2642 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 2643 | ? armnnUtils::GetTensorInfo(1, 1, 2, 2, dataLayout, ArmnnType) |
| 2644 | : armnnUtils::GetTensorInfo(1, 2, 2, 2, dataLayout, ArmnnType); |
| 2645 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 2646 | ? armnnUtils::GetTensorInfo(1, 1, 1, 1, dataLayout, ArmnnType) |
| 2647 | : armnnUtils::GetTensorInfo(1, 2, 1, 1, dataLayout, ArmnnType); |
| 2648 | |
| 2649 | if (armnn::IsQuantizedType<T>()) |
| 2650 | { |
| 2651 | inputTensorInfo.SetQuantizationScale(0.1567f); |
| 2652 | inputTensorInfo.SetQuantizationOffset(1); |
| 2653 | outputTensorInfo.SetQuantizationScale(0.1567f); |
| 2654 | outputTensorInfo.SetQuantizationOffset(1); |
| 2655 | } |
| 2656 | |
| 2657 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 2658 | ? std::initializer_list<float> |
| 2659 | { |
| 2660 | 1, 255, |
| 2661 | 200, 250 |
| 2662 | } |
| 2663 | : std::initializer_list<float> |
| 2664 | { |
| 2665 | 1.0f, 255.0f, |
| 2666 | 200.0f, 250.0f, |
| 2667 | |
| 2668 | 250.0f, 200.0f, |
| 2669 | 250.0f, 1.0f |
| 2670 | }; |
| 2671 | |
| 2672 | // The 'resize bilinear' operation projects the top-left corner of output texels into the input image, |
| 2673 | // then figures out the interpolants and weights. Note this is different to projecting the centre of the |
| 2674 | // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as |
| 2675 | // its single element, the value that was at position (0,0) of the input matrix (rather than an average, |
| 2676 | // which we would expect if projecting the centre). |
| 2677 | |
| 2678 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 2679 | ? std::initializer_list<float> |
| 2680 | { |
| 2681 | 1 |
| 2682 | } |
| 2683 | : std::initializer_list<float> |
| 2684 | { |
| 2685 | 1.0f, |
| 2686 | |
| 2687 | 250.0f |
| 2688 | }; |
| 2689 | |
| 2690 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 2691 | if (dataLayout == armnn::DataLayout::NHWC) |
| 2692 | { |
| 2693 | std::vector<float> tmp(inputData.size()); |
| 2694 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 2695 | inputData = tmp; |
| 2696 | |
| 2697 | std::vector<float> tmp1(outputData.size()); |
| 2698 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 2699 | outputData = tmp1; |
| 2700 | } |
| 2701 | |
| 2702 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 2703 | inputTensorInfo.GetQuantizationOffset(), |
| 2704 | inputData)); |
| 2705 | |
| 2706 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 2707 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 2708 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 2709 | outputTensorInfo.GetQuantizationOffset(), |
| 2710 | outputData)); |
| 2711 | |
| 2712 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2713 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2714 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2715 | armnn::ResizeQueueDescriptor descriptor; |
| 2716 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::Bilinear; |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2717 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2718 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2719 | armnn::WorkloadInfo info; |
| 2720 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2721 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2722 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2723 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2724 | |
| 2725 | inputHandle->Allocate(); |
| 2726 | outputHandle->Allocate(); |
| 2727 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2728 | |
| 2729 | workload->PostAllocationConfigure(); |
| 2730 | workload->Execute(); |
| 2731 | |
| 2732 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 2733 | return result; |
| 2734 | } |
| 2735 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2736 | template<armnn::DataType ArmnnType, typename T> |
| 2737 | LayerTestResult<T, 4> ResizeBilinearSqMinTest( |
| 2738 | armnn::IWorkloadFactory& workloadFactory, |
| 2739 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2740 | const armnn::DataLayout dataLayout) |
| 2741 | { |
| 2742 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 2743 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 2744 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 2745 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 2746 | ? armnnUtils::GetTensorInfo(1, 1, 2, 2, dataLayout, ArmnnType) |
| 2747 | : armnnUtils::GetTensorInfo(1, 2, 2, 2, dataLayout, ArmnnType); |
| 2748 | |
| 2749 | if (armnn::IsQuantizedType<T>()) |
| 2750 | { |
| 2751 | inputTensorInfo.SetQuantizationScale(3.141592f); |
| 2752 | inputTensorInfo.SetQuantizationOffset(3); |
| 2753 | outputTensorInfo.SetQuantizationScale(3.141592f); |
| 2754 | outputTensorInfo.SetQuantizationOffset(3); |
| 2755 | } |
| 2756 | |
| 2757 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 2758 | ? std::initializer_list<float> |
| 2759 | { |
| 2760 | 1, 2, 3, 4, |
| 2761 | 2, 3, 4, 5, |
| 2762 | 3, 4, 5, 6, |
| 2763 | 4, 5, 6, 7 |
| 2764 | } |
| 2765 | : std::initializer_list<float> |
| 2766 | { |
| 2767 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 2768 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 2769 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 2770 | 4.0f, 5.0f, 6.0f, 7.0f, |
| 2771 | |
| 2772 | 7.0f, 6.0f, 5.0f, 4.0f, |
| 2773 | 6.0f, 5.0f, 4.0f, 3.0f, |
| 2774 | 5.0f, 4.0f, 3.0f, 2.0f, |
| 2775 | 4.0f, 3.0f, 2.0f, 1.0f |
| 2776 | }; |
| 2777 | |
| 2778 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 2779 | ? std::initializer_list<float> |
| 2780 | { |
| 2781 | 1, 3, |
| 2782 | 3, 5 |
| 2783 | } |
| 2784 | : std::initializer_list<float> |
| 2785 | { |
| 2786 | 1.0f, 3.0f, |
| 2787 | 3.0f, 5.0f, |
| 2788 | |
| 2789 | 7.0f, 5.0f, |
| 2790 | 5.0f, 3.0f |
| 2791 | }; |
| 2792 | |
| 2793 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 2794 | if (dataLayout == armnn::DataLayout::NHWC) |
| 2795 | { |
| 2796 | std::vector<float> tmp(inputData.size()); |
| 2797 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 2798 | inputData = tmp; |
| 2799 | |
| 2800 | std::vector<float> tmp1(outputData.size()); |
| 2801 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 2802 | outputData = tmp1; |
| 2803 | } |
| 2804 | |
| 2805 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 2806 | inputTensorInfo.GetQuantizationOffset(), |
| 2807 | inputData)); |
| 2808 | |
| 2809 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 2810 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 2811 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 2812 | outputTensorInfo.GetQuantizationOffset(), |
| 2813 | outputData)); |
| 2814 | |
| 2815 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2816 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2817 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2818 | armnn::ResizeQueueDescriptor descriptor; |
| 2819 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::Bilinear; |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2820 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2821 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2822 | armnn::WorkloadInfo info; |
| 2823 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2824 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2825 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2826 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2827 | |
| 2828 | inputHandle->Allocate(); |
| 2829 | outputHandle->Allocate(); |
| 2830 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2831 | |
| 2832 | workload->PostAllocationConfigure(); |
| 2833 | workload->Execute(); |
| 2834 | |
| 2835 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 2836 | return result; |
| 2837 | } |
| 2838 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2839 | template<armnn::DataType ArmnnType, typename T> |
| 2840 | LayerTestResult<T, 4> ResizeBilinearMinTest( |
| 2841 | armnn::IWorkloadFactory& workloadFactory, |
| 2842 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2843 | const armnn::DataLayout dataLayout) |
| 2844 | { |
| 2845 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 2846 | ? armnnUtils::GetTensorInfo(1, 1, 2, 3, dataLayout, ArmnnType) |
| 2847 | : armnnUtils::GetTensorInfo(1, 2, 3, 5, dataLayout, ArmnnType); |
| 2848 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 2849 | ? armnnUtils::GetTensorInfo(1, 1, 1, 2, dataLayout, ArmnnType) |
| 2850 | : armnnUtils::GetTensorInfo(1, 2, 2, 3, dataLayout, ArmnnType); |
| 2851 | |
| 2852 | if (armnn::IsQuantizedType<T>()) |
| 2853 | { |
| 2854 | inputTensorInfo.SetQuantizationScale(1.5f); |
| 2855 | inputTensorInfo.SetQuantizationOffset(-1); |
| 2856 | outputTensorInfo.SetQuantizationScale(1.5f); |
| 2857 | outputTensorInfo.SetQuantizationOffset(-1); |
| 2858 | } |
| 2859 | |
| 2860 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 2861 | ? std::initializer_list<float> |
| 2862 | { |
| 2863 | 3.0f, 4.5f, 6.0f, // 1, 2, 3, : Expected quantised values |
| 2864 | 9.0f, 13.5f, 21.0f // 5, 8, 13 |
| 2865 | } |
| 2866 | : std::initializer_list<float> |
| 2867 | { |
| 2868 | 1.0f, 2.0f, 3.0f, 5.0f, 8.0f, |
| 2869 | 13.0f, 21.0f, 34.0f, 55.0f, 89.0f, |
| 2870 | 144.0f, 233.0f, 377.0f, 610.0f, 987.0f, |
| 2871 | |
| 2872 | 987.0f, 610.0f, 377.0f, 233.0f, 144.0f, |
| 2873 | 89.0f, 55.0f, 34.0f, 21.0f, 13.0f, |
| 2874 | 8.0f, 5.0f, 3.0f, 2.0f, 1.0f |
| 2875 | }; |
| 2876 | |
| 2877 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 2878 | ? std::initializer_list<float> |
| 2879 | { |
| 2880 | 3.0f, 5.25f // 1, 3 |
| 2881 | } |
| 2882 | : std::initializer_list<float> |
| 2883 | { |
| 2884 | 1.0f, 2.6666f, 6.00f, |
| 2885 | 78.5f, 179.3333f, 401.00f, |
| 2886 | |
| 2887 | 987.0f, 454.6670f, 203.33f, |
| 2888 | 48.5f, 22.3333f, 10.00f |
| 2889 | }; |
| 2890 | |
| 2891 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 2892 | if (dataLayout == armnn::DataLayout::NHWC) |
| 2893 | { |
| 2894 | std::vector<float> tmp(inputData.size()); |
| 2895 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 2896 | inputData = tmp; |
| 2897 | |
| 2898 | std::vector<float> tmp1(outputData.size()); |
| 2899 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 2900 | outputData = tmp1; |
| 2901 | } |
| 2902 | |
| 2903 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 2904 | inputTensorInfo.GetQuantizationOffset(), |
| 2905 | inputData)); |
| 2906 | |
| 2907 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 2908 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 2909 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 2910 | outputTensorInfo.GetQuantizationOffset(), |
| 2911 | outputData)); |
| 2912 | |
| 2913 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 2914 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 2915 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2916 | armnn::ResizeQueueDescriptor descriptor; |
| 2917 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::Bilinear; |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2918 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2919 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2920 | armnn::WorkloadInfo info; |
| 2921 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 2922 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 2923 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 2924 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2925 | |
| 2926 | inputHandle->Allocate(); |
| 2927 | outputHandle->Allocate(); |
| 2928 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 2929 | |
| 2930 | workload->PostAllocationConfigure(); |
| 2931 | workload->Execute(); |
| 2932 | |
| 2933 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 2934 | return result; |
| 2935 | } |
| 2936 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 2937 | template<armnn::DataType ArmnnType, typename T> |
| 2938 | LayerTestResult<T, 4> ResizeBilinearMagTest( |
| 2939 | armnn::IWorkloadFactory& workloadFactory, |
| 2940 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 2941 | const armnn::DataLayout dataLayout) |
| 2942 | { |
| 2943 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 2944 | ? armnnUtils::GetTensorInfo(1, 1, 3, 2, dataLayout, ArmnnType) |
| 2945 | : armnnUtils::GetTensorInfo(1, 2, 3, 2, dataLayout, ArmnnType); |
| 2946 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 2947 | ? armnnUtils::GetTensorInfo(1, 1, 3, 5, dataLayout, ArmnnType) |
| 2948 | : armnnUtils::GetTensorInfo(1, 2, 3, 5, dataLayout, ArmnnType); |
| 2949 | |
| 2950 | if (armnn::IsQuantizedType<T>()) |
| 2951 | { |
| 2952 | inputTensorInfo.SetQuantizationScale(0.010765f); |
| 2953 | inputTensorInfo.SetQuantizationOffset(7); |
| 2954 | outputTensorInfo.SetQuantizationScale(0.010132f); |
| 2955 | outputTensorInfo.SetQuantizationOffset(-18); |
| 2956 | } |
| 2957 | |
| 2958 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 2959 | ? std::initializer_list<float> |
| 2960 | { |
| 2961 | 0.183005f, 2.379065f, // 24, 228, : Expected quantised values |
| 2962 | 1.05497f, 1.302565f, // 105, 128, |
| 2963 | 2.400595f, 0.68896f // 230, 71 |
| 2964 | } |
| 2965 | : std::initializer_list<float> |
| 2966 | { |
| 2967 | 1.0f, 2.0f, |
| 2968 | 13.0f, 21.0f, |
| 2969 | 144.0f, 233.0f, |
| 2970 | |
| 2971 | 233.0f, 144.0f, |
| 2972 | 21.0f, 13.0f, |
| 2973 | 2.0f, 1.0f |
| 2974 | }; |
| 2975 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 2976 | ? std::initializer_list<float> |
| 2977 | { |
| 2978 | 0.18300501f, 1.06142902f, 1.93985295f, 2.37906504f, 2.37906504f, |
| 2979 | 1.05497003f, 1.15400803f, 1.25304604f, 1.30256498f, 1.30256498f, |
| 2980 | 2.40059495f, 1.71594095f, 1.03128707f, 0.68896002f, 0.68896002f |
| 2981 | // 0, 87, 173, 217, 217, : Expected quantised values |
| 2982 | // 86, 96, 106, 111, 111, |
| 2983 | // 219, 151, 84, 50, 50 |
| 2984 | } |
| 2985 | : std::initializer_list<float> |
| 2986 | { |
| 2987 | 1.0f, 1.4f, 1.8f, 2.0f, 2.0f, |
| 2988 | 13.0f, 16.2f, 19.4f, 21.0f, 21.0f, |
| 2989 | 144.0f, 179.6f, 215.2f, 233.0f, 233.0f, |
| 2990 | |
| 2991 | 233.0f, 197.4f, 161.8f, 144.0f, 144.0f, |
| 2992 | 21.0f, 17.8f, 14.6f, 13.0f, 13.0f, |
| 2993 | 2.0f, 1.6f, 1.2f, 1.0f, 1.0f |
| 2994 | }; |
| 2995 | |
| 2996 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 2997 | if (dataLayout == armnn::DataLayout::NHWC) |
| 2998 | { |
| 2999 | std::vector<float> tmp(inputData.size()); |
| 3000 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3001 | inputData = tmp; |
| 3002 | |
| 3003 | std::vector<float> tmp1(outputData.size()); |
| 3004 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 3005 | outputData = tmp1; |
| 3006 | } |
| 3007 | |
| 3008 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3009 | inputTensorInfo.GetQuantizationOffset(), |
| 3010 | inputData)); |
| 3011 | |
| 3012 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3013 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3014 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3015 | outputTensorInfo.GetQuantizationOffset(), |
| 3016 | outputData)); |
| 3017 | |
| 3018 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3019 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3020 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 3021 | armnn::ResizeQueueDescriptor descriptor; |
| 3022 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::Bilinear; |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 3023 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 3024 | |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 3025 | armnn::WorkloadInfo info; |
| 3026 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3027 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3028 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 3029 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
Ellen Norris-Thompson | c4223d1 | 2019-06-10 14:15:12 +0100 | [diff] [blame] | 3030 | |
| 3031 | inputHandle->Allocate(); |
| 3032 | outputHandle->Allocate(); |
| 3033 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3034 | |
| 3035 | workload->PostAllocationConfigure(); |
| 3036 | workload->Execute(); |
| 3037 | |
| 3038 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3039 | return result; |
| 3040 | } |
| 3041 | |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3042 | |
| 3043 | template<armnn::DataType ArmnnType, typename T> |
| 3044 | LayerTestResult<T, 4> ResizeNearestNeighborNopTest( |
| 3045 | armnn::IWorkloadFactory& workloadFactory, |
| 3046 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3047 | const armnn::DataLayout dataLayout) |
| 3048 | { |
| 3049 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 3050 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 3051 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 3052 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 3053 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 3054 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 3055 | if (armnn::IsQuantizedType<T>()) |
| 3056 | { |
| 3057 | inputTensorInfo.SetQuantizationScale(1.5f); |
| 3058 | inputTensorInfo.SetQuantizationOffset(-3); |
| 3059 | outputTensorInfo.SetQuantizationScale(1.5f); |
| 3060 | outputTensorInfo.SetQuantizationOffset(-3); |
| 3061 | } |
| 3062 | |
| 3063 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 3064 | ? std::initializer_list<float> |
| 3065 | { |
| 3066 | 1, 2, 3, 4, |
| 3067 | 2, 3, 4, 5, |
| 3068 | 3, 4, 5, 6, |
| 3069 | 4, 5, 6, 7 |
| 3070 | } |
| 3071 | : std::initializer_list<float> |
| 3072 | { |
| 3073 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 3074 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 3075 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 3076 | 4.0f, 5.0f, 6.0f, 7.0f, |
| 3077 | |
| 3078 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 3079 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 3080 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 3081 | 4.0f, 5.0f, 6.0f, 7.0f |
| 3082 | }; |
| 3083 | |
| 3084 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 3085 | if (dataLayout == armnn::DataLayout::NHWC) |
| 3086 | { |
| 3087 | std::vector<float> tmp(inputData.size()); |
| 3088 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3089 | inputData = tmp; |
| 3090 | } |
| 3091 | |
| 3092 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3093 | inputTensorInfo.GetQuantizationOffset(), |
| 3094 | inputData)); |
| 3095 | |
| 3096 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3097 | result.outputExpected = input; |
| 3098 | |
| 3099 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3100 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3101 | |
| 3102 | armnn::ResizeQueueDescriptor descriptor; |
| 3103 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::NearestNeighbor; |
| 3104 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
| 3105 | armnn::WorkloadInfo info; |
| 3106 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3107 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3108 | |
| 3109 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
| 3110 | |
| 3111 | inputHandle->Allocate(); |
| 3112 | outputHandle->Allocate(); |
| 3113 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3114 | |
| 3115 | workload->PostAllocationConfigure(); |
| 3116 | workload->Execute(); |
| 3117 | |
| 3118 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3119 | return result; |
| 3120 | } |
| 3121 | |
| 3122 | template<armnn::DataType ArmnnType, typename T> |
| 3123 | LayerTestResult<T, 4> SimpleResizeNearestNeighborTest( |
| 3124 | armnn::IWorkloadFactory& workloadFactory, |
| 3125 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3126 | const armnn::DataLayout dataLayout) |
| 3127 | { |
| 3128 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 3129 | ? armnnUtils::GetTensorInfo(1, 1, 2, 2, dataLayout, ArmnnType) |
| 3130 | : armnnUtils::GetTensorInfo(1, 2, 2, 2, dataLayout, ArmnnType); |
| 3131 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 3132 | ? armnnUtils::GetTensorInfo(1, 1, 1, 1, dataLayout, ArmnnType) |
| 3133 | : armnnUtils::GetTensorInfo(1, 2, 1, 1, dataLayout, ArmnnType); |
| 3134 | |
| 3135 | if (armnn::IsQuantizedType<T>()) |
| 3136 | { |
| 3137 | inputTensorInfo.SetQuantizationScale(0.1567f); |
| 3138 | inputTensorInfo.SetQuantizationOffset(1); |
| 3139 | outputTensorInfo.SetQuantizationScale(0.1567f); |
| 3140 | outputTensorInfo.SetQuantizationOffset(1); |
| 3141 | } |
| 3142 | |
| 3143 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 3144 | ? std::initializer_list<float> |
| 3145 | { |
| 3146 | 1, 255, |
| 3147 | 200, 250 |
| 3148 | } |
| 3149 | : std::initializer_list<float> |
| 3150 | { |
| 3151 | 1.0f, 255.0f, |
| 3152 | 200.0f, 250.0f, |
| 3153 | |
| 3154 | 250.0f, 200.0f, |
| 3155 | 250.0f, 1.0f |
| 3156 | }; |
| 3157 | |
| 3158 | // The 'resize' operation projects the top-left corner of output texels into the input image, |
| 3159 | // then figures out the interpolants and weights. Note this is different to projecting the centre of the |
| 3160 | // output texel. Thus, for a input matrix of 2x2, we'll expect the output 1x1 matrix to contain, as |
| 3161 | // its single element, the value that was at position (0,0) of the input matrix (rather than an average, |
| 3162 | // which we would expect if projecting the centre). |
| 3163 | |
| 3164 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 3165 | ? std::initializer_list<float> |
| 3166 | { |
| 3167 | 1 |
| 3168 | } |
| 3169 | : std::initializer_list<float> |
| 3170 | { |
| 3171 | 1.0f, |
| 3172 | |
| 3173 | 250.0f |
| 3174 | }; |
| 3175 | |
| 3176 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 3177 | if (dataLayout == armnn::DataLayout::NHWC) |
| 3178 | { |
| 3179 | std::vector<float> tmp(inputData.size()); |
| 3180 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3181 | inputData = tmp; |
| 3182 | |
| 3183 | std::vector<float> tmp1(outputData.size()); |
| 3184 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 3185 | outputData = tmp1; |
| 3186 | } |
| 3187 | |
| 3188 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3189 | inputTensorInfo.GetQuantizationOffset(), |
| 3190 | inputData)); |
| 3191 | |
| 3192 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3193 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3194 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3195 | outputTensorInfo.GetQuantizationOffset(), |
| 3196 | outputData)); |
| 3197 | |
| 3198 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3199 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3200 | |
| 3201 | armnn::ResizeQueueDescriptor descriptor; |
| 3202 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
| 3203 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::NearestNeighbor; |
| 3204 | armnn::WorkloadInfo info; |
| 3205 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3206 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3207 | |
| 3208 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
| 3209 | |
| 3210 | inputHandle->Allocate(); |
| 3211 | outputHandle->Allocate(); |
| 3212 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3213 | |
| 3214 | workload->PostAllocationConfigure(); |
| 3215 | workload->Execute(); |
| 3216 | |
| 3217 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3218 | return result; |
| 3219 | } |
| 3220 | |
| 3221 | template<armnn::DataType ArmnnType, typename T> |
| 3222 | LayerTestResult<T, 4> ResizeNearestNeighborSqMinTest( |
| 3223 | armnn::IWorkloadFactory& workloadFactory, |
| 3224 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3225 | const armnn::DataLayout dataLayout) |
| 3226 | { |
| 3227 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 3228 | ? armnnUtils::GetTensorInfo(1, 1, 4, 4, dataLayout, ArmnnType) |
| 3229 | : armnnUtils::GetTensorInfo(1, 2, 4, 4, dataLayout, ArmnnType); |
| 3230 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 3231 | ? armnnUtils::GetTensorInfo(1, 1, 2, 2, dataLayout, ArmnnType) |
| 3232 | : armnnUtils::GetTensorInfo(1, 2, 2, 2, dataLayout, ArmnnType); |
| 3233 | |
| 3234 | if (armnn::IsQuantizedType<T>()) |
| 3235 | { |
| 3236 | inputTensorInfo.SetQuantizationScale(3.141592f); |
| 3237 | inputTensorInfo.SetQuantizationOffset(3); |
| 3238 | outputTensorInfo.SetQuantizationScale(3.141592f); |
| 3239 | outputTensorInfo.SetQuantizationOffset(3); |
| 3240 | } |
| 3241 | |
| 3242 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 3243 | ? std::initializer_list<float> |
| 3244 | { |
| 3245 | 1, 2, 3, 4, |
| 3246 | 2, 3, 4, 5, |
| 3247 | 3, 4, 5, 6, |
| 3248 | 4, 5, 6, 7 |
| 3249 | } |
| 3250 | : std::initializer_list<float> |
| 3251 | { |
| 3252 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 3253 | 2.0f, 3.0f, 4.0f, 5.0f, |
| 3254 | 3.0f, 4.0f, 5.0f, 6.0f, |
| 3255 | 4.0f, 5.0f, 6.0f, 7.0f, |
| 3256 | |
| 3257 | 7.0f, 6.0f, 5.0f, 4.0f, |
| 3258 | 6.0f, 5.0f, 4.0f, 3.0f, |
| 3259 | 5.0f, 4.0f, 3.0f, 2.0f, |
| 3260 | 4.0f, 3.0f, 2.0f, 1.0f |
| 3261 | }; |
| 3262 | |
| 3263 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 3264 | ? std::initializer_list<float> |
| 3265 | { |
| 3266 | 1, 3, |
| 3267 | 3, 5 |
| 3268 | } |
| 3269 | : std::initializer_list<float> |
| 3270 | { |
| 3271 | 1.0f, 3.0f, |
| 3272 | 3.0f, 5.0f, |
| 3273 | |
| 3274 | 7.0f, 5.0f, |
| 3275 | 5.0f, 3.0f |
| 3276 | }; |
| 3277 | |
| 3278 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 3279 | if (dataLayout == armnn::DataLayout::NHWC) |
| 3280 | { |
| 3281 | std::vector<float> tmp(inputData.size()); |
| 3282 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3283 | inputData = tmp; |
| 3284 | |
| 3285 | std::vector<float> tmp1(outputData.size()); |
| 3286 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 3287 | outputData = tmp1; |
| 3288 | } |
| 3289 | |
| 3290 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3291 | inputTensorInfo.GetQuantizationOffset(), |
| 3292 | inputData)); |
| 3293 | |
| 3294 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3295 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3296 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3297 | outputTensorInfo.GetQuantizationOffset(), |
| 3298 | outputData)); |
| 3299 | |
| 3300 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3301 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3302 | |
| 3303 | armnn::ResizeQueueDescriptor descriptor; |
| 3304 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
| 3305 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::NearestNeighbor; |
| 3306 | armnn::WorkloadInfo info; |
| 3307 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3308 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3309 | |
| 3310 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
| 3311 | |
| 3312 | inputHandle->Allocate(); |
| 3313 | outputHandle->Allocate(); |
| 3314 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3315 | |
| 3316 | workload->PostAllocationConfigure(); |
| 3317 | workload->Execute(); |
| 3318 | |
| 3319 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3320 | return result; |
| 3321 | } |
| 3322 | |
| 3323 | template<armnn::DataType ArmnnType, typename T> |
| 3324 | LayerTestResult<T, 4> ResizeNearestNeighborMinTest( |
| 3325 | armnn::IWorkloadFactory& workloadFactory, |
| 3326 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3327 | const armnn::DataLayout dataLayout) |
| 3328 | { |
| 3329 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 3330 | ? armnnUtils::GetTensorInfo(1, 1, 2, 3, dataLayout, ArmnnType) |
| 3331 | : armnnUtils::GetTensorInfo(1, 2, 3, 5, dataLayout, ArmnnType); |
| 3332 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 3333 | ? armnnUtils::GetTensorInfo(1, 1, 1, 2, dataLayout, ArmnnType) |
| 3334 | : armnnUtils::GetTensorInfo(1, 2, 2, 3, dataLayout, ArmnnType); |
| 3335 | |
| 3336 | if (armnn::IsQuantizedType<T>()) |
| 3337 | { |
| 3338 | inputTensorInfo.SetQuantizationScale(1.5f); |
| 3339 | inputTensorInfo.SetQuantizationOffset(-1); |
| 3340 | outputTensorInfo.SetQuantizationScale(1.5f); |
| 3341 | outputTensorInfo.SetQuantizationOffset(-1); |
| 3342 | } |
| 3343 | |
| 3344 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 3345 | ? std::initializer_list<float> |
| 3346 | { |
| 3347 | 3.0f, 4.5f, 6.0f, // 1, 2, 3, : Expected quantised values |
| 3348 | 9.0f, 13.5f, 21.0f // 5, 8, 13 |
| 3349 | } |
| 3350 | : std::initializer_list<float> |
| 3351 | { |
| 3352 | 1.0f, 2.0f, 3.0f, 5.0f, 8.0f, |
| 3353 | 13.0f, 21.0f, 34.0f, 55.0f, 89.0f, |
| 3354 | 144.0f, 233.0f, 377.0f, 610.0f, 987.0f, |
| 3355 | |
| 3356 | 987.0f, 610.0f, 377.0f, 233.0f, 144.0f, |
| 3357 | 89.0f, 55.0f, 34.0f, 21.0f, 13.0f, |
| 3358 | 8.0f, 5.0f, 3.0f, 2.0f, 1.0f |
| 3359 | }; |
| 3360 | |
| 3361 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 3362 | ? std::initializer_list<float> |
| 3363 | { |
| 3364 | 3.0f, 4.5f // 1, 3 |
| 3365 | } |
| 3366 | : std::initializer_list<float> |
| 3367 | { |
| 3368 | 1.f, 2.f, 5.f, |
| 3369 | 13.f, 21.f, 55.f, |
| 3370 | |
| 3371 | 987.f, 610.f, 233.f, |
| 3372 | 89.f, 55.f, 21.f |
| 3373 | }; |
| 3374 | |
| 3375 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 3376 | if (dataLayout == armnn::DataLayout::NHWC) |
| 3377 | { |
| 3378 | std::vector<float> tmp(inputData.size()); |
| 3379 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3380 | inputData = tmp; |
| 3381 | |
| 3382 | std::vector<float> tmp1(outputData.size()); |
| 3383 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 3384 | outputData = tmp1; |
| 3385 | } |
| 3386 | |
| 3387 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3388 | inputTensorInfo.GetQuantizationOffset(), |
| 3389 | inputData)); |
| 3390 | |
| 3391 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3392 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3393 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3394 | outputTensorInfo.GetQuantizationOffset(), |
| 3395 | outputData)); |
| 3396 | |
| 3397 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3398 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3399 | |
| 3400 | armnn::ResizeQueueDescriptor descriptor; |
| 3401 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
| 3402 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::NearestNeighbor; |
| 3403 | armnn::WorkloadInfo info; |
| 3404 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3405 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3406 | |
| 3407 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
| 3408 | |
| 3409 | inputHandle->Allocate(); |
| 3410 | outputHandle->Allocate(); |
| 3411 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3412 | |
| 3413 | workload->PostAllocationConfigure(); |
| 3414 | workload->Execute(); |
| 3415 | |
| 3416 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3417 | return result; |
| 3418 | } |
| 3419 | |
| 3420 | template<armnn::DataType ArmnnType, typename T> |
| 3421 | LayerTestResult<T, 4> ResizeNearestNeighborMagTest( |
| 3422 | armnn::IWorkloadFactory& workloadFactory, |
| 3423 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3424 | const armnn::DataLayout dataLayout, |
| 3425 | float inQuantScale, |
| 3426 | int32_t inQuantOffset, |
| 3427 | float outQuantScale, |
| 3428 | int32_t outQuantOffset) |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3429 | { |
| 3430 | armnn::TensorInfo inputTensorInfo = armnn::IsQuantizedType<T>() |
| 3431 | ? armnnUtils::GetTensorInfo(1, 1, 3, 2, dataLayout, ArmnnType) |
| 3432 | : armnnUtils::GetTensorInfo(1, 2, 3, 2, dataLayout, ArmnnType); |
| 3433 | armnn::TensorInfo outputTensorInfo = armnn::IsQuantizedType<T>() |
| 3434 | ? armnnUtils::GetTensorInfo(1, 1, 3, 5, dataLayout, ArmnnType) |
| 3435 | : armnnUtils::GetTensorInfo(1, 2, 3, 5, dataLayout, ArmnnType); |
| 3436 | |
| 3437 | if (armnn::IsQuantizedType<T>()) |
| 3438 | { |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3439 | inputTensorInfo.SetQuantizationScale(inQuantScale); |
| 3440 | inputTensorInfo.SetQuantizationOffset(inQuantOffset); |
| 3441 | outputTensorInfo.SetQuantizationScale(outQuantScale); |
| 3442 | outputTensorInfo.SetQuantizationOffset(outQuantOffset); |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3443 | } |
| 3444 | |
| 3445 | std::vector<float> inputData = armnn::IsQuantizedType<T>() |
| 3446 | ? std::initializer_list<float> |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3447 | { |
| 3448 | 0.183005f, 2.379065f, // 24, 228, : expected quantised values |
| 3449 | 1.054970f, 1.302565f, // 105, 128, |
| 3450 | 2.400595f, 0.688960f // 230, 71 |
| 3451 | } |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3452 | : std::initializer_list<float> |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3453 | { |
| 3454 | 1.0f, 2.0f, |
| 3455 | 13.0f, 21.0f, |
| 3456 | 144.0f, 233.0f, |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3457 | |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3458 | 233.0f, 144.0f, |
| 3459 | 21.0f, 13.0f, |
| 3460 | 2.0f, 1.0f |
| 3461 | }; |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3462 | std::vector<float> outputData = armnn::IsQuantizedType<T>() |
| 3463 | ? std::initializer_list<float> |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3464 | { |
| 3465 | 0.183005f, 0.183005f, 0.183005f, 2.379065f, 2.379065f, |
| 3466 | 1.054970f, 1.054970f, 1.054970f, 1.302565f, 1.302565f, |
| 3467 | 2.400595f, 2.400595f, 2.400595f, 0.688960f, 0.688960f |
| 3468 | } |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3469 | : std::initializer_list<float> |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3470 | { |
| 3471 | 1.f, 1.f, 1.f, 2.f, 2.f, |
| 3472 | 13.f, 13.f, 13.f, 21.f, 21.f, |
| 3473 | 144.f, 144.f, 144.f, 233.f, 233.f, |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3474 | |
Aron Virginas-Tar | cc0cefb | 2019-07-02 17:25:47 +0100 | [diff] [blame] | 3475 | 233.f, 233.f, 233.f, 144.f, 144.f, |
| 3476 | 21.f, 21.f, 21.f, 13.f, 13.f, |
| 3477 | 2.f, 2.f, 2.f, 1.f, 1.f |
| 3478 | }; |
Teresa Charlin | 970f43b | 2019-07-01 13:51:07 +0100 | [diff] [blame] | 3479 | |
| 3480 | const armnn::PermutationVector NCHWToNHWC = { 0, 3, 1, 2 }; |
| 3481 | if (dataLayout == armnn::DataLayout::NHWC) |
| 3482 | { |
| 3483 | std::vector<float> tmp(inputData.size()); |
| 3484 | armnnUtils::Permute(inputTensorInfo.GetShape(), NCHWToNHWC, inputData.data(), tmp.data(), sizeof(float)); |
| 3485 | inputData = tmp; |
| 3486 | |
| 3487 | std::vector<float> tmp1(outputData.size()); |
| 3488 | armnnUtils::Permute(outputTensorInfo.GetShape(), NCHWToNHWC, outputData.data(), tmp1.data(), sizeof(float)); |
| 3489 | outputData = tmp1; |
| 3490 | } |
| 3491 | |
| 3492 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3493 | inputTensorInfo.GetQuantizationOffset(), |
| 3494 | inputData)); |
| 3495 | |
| 3496 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3497 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3498 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3499 | outputTensorInfo.GetQuantizationOffset(), |
| 3500 | outputData)); |
| 3501 | |
| 3502 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3503 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3504 | |
| 3505 | armnn::ResizeQueueDescriptor descriptor; |
| 3506 | descriptor.m_Parameters.m_DataLayout = dataLayout; |
| 3507 | descriptor.m_Parameters.m_Method = armnn::ResizeMethod::NearestNeighbor; |
| 3508 | armnn::WorkloadInfo info; |
| 3509 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3510 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3511 | |
| 3512 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateResize(descriptor, info); |
| 3513 | |
| 3514 | inputHandle->Allocate(); |
| 3515 | outputHandle->Allocate(); |
| 3516 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3517 | |
| 3518 | workload->PostAllocationConfigure(); |
| 3519 | workload->Execute(); |
| 3520 | |
| 3521 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3522 | return result; |
| 3523 | } |
| 3524 | |
James Conroy | 4d1ff58 | 2019-06-10 17:06:39 +0100 | [diff] [blame] | 3525 | template<armnn::DataType ArmnnType, typename T, std::size_t InputDim, std::size_t OutputDim> |
| 3526 | LayerTestResult<T, OutputDim> MeanTestHelper( |
| 3527 | armnn::IWorkloadFactory& workloadFactory, |
| 3528 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3529 | const unsigned int* inputShape, |
| 3530 | const std::vector<float>& inputData, |
| 3531 | const std::vector<unsigned int>& axis, |
| 3532 | bool keepDims, |
| 3533 | const unsigned int* outputShape, |
| 3534 | const std::vector<float>& outputData, |
| 3535 | float scale = 1.0f, |
| 3536 | int32_t offset = 0) |
| 3537 | { |
| 3538 | armnn::TensorInfo inputTensorInfo(InputDim, inputShape, ArmnnType); |
| 3539 | armnn::TensorInfo outputTensorInfo(OutputDim, outputShape, ArmnnType); |
| 3540 | |
| 3541 | inputTensorInfo.SetQuantizationScale(scale); |
| 3542 | inputTensorInfo.SetQuantizationOffset(offset); |
| 3543 | |
| 3544 | outputTensorInfo.SetQuantizationScale(scale); |
| 3545 | outputTensorInfo.SetQuantizationOffset(offset); |
| 3546 | |
| 3547 | auto input = MakeTensor<T, InputDim>(inputTensorInfo, ConvertToDataType<ArmnnType>(inputData, inputTensorInfo)); |
| 3548 | |
| 3549 | LayerTestResult<T, OutputDim> result(outputTensorInfo); |
| 3550 | result.outputExpected = MakeTensor<T, OutputDim>( |
| 3551 | outputTensorInfo, ConvertToDataType<ArmnnType>(outputData, outputTensorInfo)); |
| 3552 | |
| 3553 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3554 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3555 | |
| 3556 | armnn::MeanQueueDescriptor data; |
| 3557 | data.m_Parameters.m_Axis = axis; |
| 3558 | data.m_Parameters.m_KeepDims = keepDims; |
| 3559 | armnn::WorkloadInfo info; |
| 3560 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 3561 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 3562 | |
| 3563 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMean(data, info); |
| 3564 | |
| 3565 | inputHandle->Allocate(); |
| 3566 | outputHandle->Allocate(); |
| 3567 | |
| 3568 | CopyDataToITensorHandle(inputHandle.get(), input.origin()); |
| 3569 | |
| 3570 | workload->PostAllocationConfigure(); |
| 3571 | workload->Execute(); |
| 3572 | |
| 3573 | CopyDataFromITensorHandle(result.output.origin(), outputHandle.get()); |
| 3574 | |
| 3575 | return result; |
| 3576 | } |
| 3577 | |
| 3578 | template<armnn::DataType ArmnnType, typename T> |
| 3579 | LayerTestResult<T, 1> MeanSimpleTest( |
| 3580 | armnn::IWorkloadFactory& workloadFactory, |
| 3581 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3582 | { |
| 3583 | const unsigned int inputShape[] = { 3, 2 }; |
| 3584 | const unsigned int outputShape[] = { 1 }; |
| 3585 | |
| 3586 | std::vector<float> input({ 1.5f, 1.5f, 2.5f, 2.5f, 3.5f, 3.5f }); |
| 3587 | std::vector<float> output({ 2.5f }); |
| 3588 | |
| 3589 | return MeanTestHelper<ArmnnType, T, 2, 1>( |
| 3590 | workloadFactory, memoryManager, inputShape, input, {}, false, outputShape, output); |
| 3591 | } |
| 3592 | |
| 3593 | template<armnn::DataType ArmnnType, typename T> |
| 3594 | LayerTestResult<T, 3> MeanSimpleAxisTest( |
| 3595 | armnn::IWorkloadFactory& workloadFactory, |
| 3596 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3597 | { |
| 3598 | const unsigned int inputShape[] = { 2, 3, 1, 2 }; |
| 3599 | const unsigned int outputShape[] = { 3, 1, 2 }; |
| 3600 | |
| 3601 | std::vector<float> input({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f }); |
| 3602 | std::vector<float> output({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f }); |
| 3603 | |
| 3604 | return MeanTestHelper<ArmnnType, T, 4, 3>( |
| 3605 | workloadFactory, memoryManager, inputShape, input, { 0 }, false, outputShape, output); |
| 3606 | } |
| 3607 | |
| 3608 | template<armnn::DataType ArmnnType, typename T> |
| 3609 | LayerTestResult<T, 4> MeanKeepDimsTest( |
| 3610 | armnn::IWorkloadFactory& workloadFactory, |
| 3611 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3612 | { |
| 3613 | const unsigned int inputShape[] = { 1, 1, 3, 2 }; |
| 3614 | const unsigned int outputShape[] = { 1, 1, 1, 2 }; |
| 3615 | |
| 3616 | std::vector<float> input({ 1.5f, 1.5f, 2.5f, 2.5f, 3.5f, 3.5f }); |
| 3617 | std::vector<float> output({ 2.5f, 2.5f }); |
| 3618 | |
| 3619 | return MeanTestHelper<ArmnnType, T, 4, 4>( |
| 3620 | workloadFactory, memoryManager, inputShape, input, { 2 }, true, outputShape, output); |
| 3621 | } |
| 3622 | |
| 3623 | template<armnn::DataType ArmnnType, typename T> |
| 3624 | LayerTestResult<T, 4> MeanMultipleDimsTest( |
| 3625 | armnn::IWorkloadFactory& workloadFactory, |
| 3626 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3627 | { |
| 3628 | const unsigned int inputShape[] = { 2, 3, 1, 2 }; |
| 3629 | const unsigned int outputShape[] = { 1, 3, 1, 1 }; |
| 3630 | |
| 3631 | std::vector<float> input({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5 }); |
| 3632 | std::vector<float> output({ 2.0f, 4.0f, 6.0f }); |
| 3633 | |
| 3634 | return MeanTestHelper<ArmnnType, T, 4, 4>( |
| 3635 | workloadFactory, memoryManager, inputShape, input, { 0, 3 }, true, outputShape, output); |
| 3636 | } |
| 3637 | |
| 3638 | template<armnn::DataType ArmnnType, typename T> |
| 3639 | LayerTestResult<T, 1> MeanVts1Test( |
| 3640 | armnn::IWorkloadFactory& workloadFactory, |
| 3641 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3642 | { |
| 3643 | const unsigned int inputShape[] = { 4, 3, 2 }; |
| 3644 | const unsigned int outputShape[] = { 2 }; |
| 3645 | |
| 3646 | std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, |
| 3647 | 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f }); |
| 3648 | std::vector<float> output({ 12.0f, 13.0f }); |
| 3649 | |
| 3650 | return MeanTestHelper<ArmnnType, T, 3, 1>( |
| 3651 | workloadFactory, memoryManager, inputShape, input, { 0, 1 }, false, outputShape, output); |
| 3652 | } |
| 3653 | |
| 3654 | template<armnn::DataType ArmnnType, typename T> |
| 3655 | LayerTestResult<T, 3> MeanVts2Test( |
| 3656 | armnn::IWorkloadFactory& workloadFactory, |
| 3657 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3658 | { |
| 3659 | const unsigned int inputShape[] = { 4, 3, 2 }; |
| 3660 | const unsigned int outputShape[] = { 1, 3, 1 }; |
| 3661 | |
| 3662 | std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, |
| 3663 | 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f }); |
| 3664 | std::vector<float> output({ 10.5f, 12.5f, 14.5f }); |
| 3665 | |
| 3666 | return MeanTestHelper<ArmnnType, T, 3, 3>( |
| 3667 | workloadFactory, memoryManager, inputShape, input, { 0, 2 }, true, outputShape, output); |
| 3668 | } |
| 3669 | |
| 3670 | template<armnn::DataType ArmnnType, typename T> |
| 3671 | LayerTestResult<T, 3> MeanVts3Test( |
| 3672 | armnn::IWorkloadFactory& workloadFactory, |
| 3673 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3674 | { |
| 3675 | const unsigned int inputShape[] = { 1, 2, 2, 1 }; |
| 3676 | const unsigned int outputShape[] = { 1, 2, 1 }; |
| 3677 | |
| 3678 | std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f }); |
| 3679 | std::vector<float> output({ 1.5f, 3.5f }); |
| 3680 | |
| 3681 | return MeanTestHelper<ArmnnType, T, 4, 3>( |
| 3682 | workloadFactory, memoryManager, inputShape, input, { 2 }, false, outputShape, output); |
| 3683 | } |
Narumol Prangnawarat | 71c80b1 | 2019-06-17 17:45:43 +0100 | [diff] [blame] | 3684 | |
| 3685 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 3686 | LayerTestResult<T, 3> ConcatDifferentInputOutputQParamTest( |
| 3687 | armnn::IWorkloadFactory& workloadFactory, |
| 3688 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3689 | bool useSubtensor) |
| 3690 | { |
| 3691 | // Defines the tensor descriptors. |
| 3692 | armnn::TensorInfo outputTensorInfo({ 3, 6, 3 }, ArmnnType); |
| 3693 | armnn::TensorInfo inputTensorInfo1({ 3, 6, 2 }, ArmnnType); |
| 3694 | armnn::TensorInfo inputTensorInfo2({ 3, 6, 1 }, ArmnnType); |
| 3695 | |
| 3696 | std::vector<armnn::TensorShape> inputTensorShapes({inputTensorInfo1.GetShape(), inputTensorInfo2.GetShape()}); |
| 3697 | |
| 3698 | // Quantized input1 tensor. |
| 3699 | const float inputScale1 = 0.5f; |
| 3700 | const int32_t inputOffset1 = 5; |
| 3701 | |
| 3702 | auto input1 = MakeTensor<T, 3>(inputTensorInfo1, std::vector<T>( |
| 3703 | { |
| 3704 | 1, 2, 3, |
| 3705 | 4, 5, 6, |
| 3706 | 7, 8, 9, |
| 3707 | 10, 11, 12, |
| 3708 | 13, 14, 15, |
| 3709 | 16, 17, 18, |
| 3710 | |
| 3711 | 19, 20, 21, |
| 3712 | 22, 23, 24, |
| 3713 | 25, 26, 27, |
| 3714 | 28, 29, 30, |
| 3715 | 31, 32, 33, |
| 3716 | 34, 35, 36 |
| 3717 | })); |
| 3718 | |
| 3719 | // Quatized input2 tensor. |
| 3720 | const float inputScale2 = 0.2f; |
| 3721 | const int32_t inputOffset2 = 10; |
| 3722 | |
| 3723 | auto input2 = MakeTensor<T, 3>(inputTensorInfo2, std::vector<T>( |
| 3724 | { |
| 3725 | 37, 38, 39, |
| 3726 | 40, 41, 42, |
| 3727 | 43, 44, 45, |
| 3728 | 46, 47, 48, |
| 3729 | 49, 50, 51, |
| 3730 | 52, 53, 54 |
| 3731 | })); |
| 3732 | |
| 3733 | // Quantized output tensor. |
| 3734 | const float outputScale = 0.1f; |
| 3735 | const int32_t outputOffset = 20; |
| 3736 | |
| 3737 | LayerTestResult<T, 3> ret(outputTensorInfo); |
| 3738 | |
| 3739 | ret.outputExpected = MakeTensor<T, 3>(outputTensorInfo, std::vector<T>( |
| 3740 | { |
| 3741 | 0, 5, 74, |
| 3742 | 10, 15, 76, |
| 3743 | 20, 25, 78, |
| 3744 | 30, 35, 80, |
| 3745 | 40, 45, 82, |
| 3746 | 50, 55, 84, |
| 3747 | |
| 3748 | 60, 65, 86, |
| 3749 | 70, 75, 88, |
| 3750 | 80, 85, 90, |
| 3751 | 90, 95, 92, |
| 3752 | 100, 105, 94, |
| 3753 | 110, 115, 96, |
| 3754 | |
| 3755 | 120, 125, 98, |
| 3756 | 130, 135, 100, |
| 3757 | 140, 145, 102, |
| 3758 | 150, 155, 104, |
| 3759 | 160, 165, 106, |
| 3760 | 170, 175, 108 |
| 3761 | })); |
| 3762 | |
| 3763 | outputTensorInfo.SetQuantizationScale(outputScale); |
| 3764 | outputTensorInfo.SetQuantizationOffset(outputOffset); |
| 3765 | inputTensorInfo1.SetQuantizationScale(inputScale1); |
| 3766 | inputTensorInfo1.SetQuantizationOffset(inputOffset1); |
| 3767 | inputTensorInfo2.SetQuantizationScale(inputScale2); |
| 3768 | inputTensorInfo2.SetQuantizationOffset(inputOffset2); |
| 3769 | |
| 3770 | std::vector<unsigned int> wOrigin1 = { 0, 0, 0 }; //Extent of the window is defined by size of input[0]. |
| 3771 | armnn::ConcatQueueDescriptor::ViewOrigin window1(wOrigin1); |
| 3772 | |
| 3773 | std::vector<unsigned int> wOrigin2 = { 0, 0, 2 }; //Extent of the window is defined by size of input[1]. |
| 3774 | armnn::ConcatQueueDescriptor::ViewOrigin window2(wOrigin2); |
| 3775 | |
| 3776 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3777 | |
| 3778 | bool subTensorsSupported = useSubtensor && workloadFactory.SupportsSubTensors(); |
| 3779 | |
| 3780 | std::unique_ptr<armnn::ITensorHandle> inputHandle1 = |
| 3781 | subTensorsSupported ? |
| 3782 | workloadFactory.CreateSubTensorHandle(*outputHandle, inputTensorInfo1.GetShape(), wOrigin1.data()) : |
| 3783 | workloadFactory.CreateTensorHandle(inputTensorInfo1); |
| 3784 | |
| 3785 | std::unique_ptr<armnn::ITensorHandle> inputHandle2 = |
| 3786 | subTensorsSupported ? |
| 3787 | workloadFactory.CreateSubTensorHandle(*outputHandle, inputTensorInfo2.GetShape(), wOrigin2.data()) : |
| 3788 | workloadFactory.CreateTensorHandle(inputTensorInfo2); |
| 3789 | |
| 3790 | armnn::ConcatQueueDescriptor data; |
| 3791 | armnn::OriginsDescriptor desc = armnn::CreateDescriptorForConcatenation( |
| 3792 | inputTensorShapes.begin(),inputTensorShapes.end(), 2); |
| 3793 | data.m_Parameters = desc; |
| 3794 | |
| 3795 | armnn::WorkloadInfo info; |
| 3796 | AddInputToWorkload(data, info, inputTensorInfo1, inputHandle1.get()); |
| 3797 | AddInputToWorkload(data, info, inputTensorInfo2, inputHandle2.get()); |
| 3798 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 3799 | |
| 3800 | data.m_ViewOrigins.push_back(window1); |
| 3801 | data.m_ViewOrigins.push_back(window2); |
| 3802 | |
| 3803 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(data, info); |
| 3804 | |
| 3805 | inputHandle1->Allocate(); |
| 3806 | inputHandle2->Allocate(); |
| 3807 | outputHandle->Allocate(); |
| 3808 | |
| 3809 | CopyDataToITensorHandle(inputHandle1.get(), &input1[0][0][0]); |
| 3810 | CopyDataToITensorHandle(inputHandle2.get(), &input2[0][0][0]); |
| 3811 | |
| 3812 | workload->PostAllocationConfigure(); |
| 3813 | workload->Execute(); |
| 3814 | |
| 3815 | CopyDataFromITensorHandle(&ret.output[0][0][0], outputHandle.get()); |
| 3816 | |
| 3817 | return ret; |
| 3818 | } |
Matteo Martincigh | ab9e525 | 2019-06-13 17:27:46 +0100 | [diff] [blame] | 3819 | |
| 3820 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 3821 | LayerTestResult<T, 4> PreluTest( |
| 3822 | armnn::IWorkloadFactory& workloadFactory, |
| 3823 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3824 | { |
| 3825 | armnn::TensorInfo inputTensorInfo ({ 1, 2, 2, 3 }, ArmnnType); |
| 3826 | armnn::TensorInfo alphaTensorInfo ({ 1, 1, 1, 3 }, ArmnnType); |
| 3827 | armnn::TensorInfo outputTensorInfo({ 1, 2, 2, 3 }, ArmnnType); |
| 3828 | |
| 3829 | if (armnn::IsQuantizedType<T>()) |
| 3830 | { |
| 3831 | inputTensorInfo.SetQuantizationScale(0.25f); |
| 3832 | inputTensorInfo.SetQuantizationOffset(128); |
| 3833 | alphaTensorInfo.SetQuantizationScale(0.25f); |
| 3834 | alphaTensorInfo.SetQuantizationOffset(50); |
| 3835 | outputTensorInfo.SetQuantizationScale(0.5f); |
| 3836 | outputTensorInfo.SetQuantizationOffset(120); |
| 3837 | } |
| 3838 | |
| 3839 | std::vector<float> inputData |
| 3840 | { |
| 3841 | // Expected quantized values: |
| 3842 | // 128, 128, 128, 132, 132, 132, 124, 124, 124, 120, 120, 120 |
| 3843 | 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -2.0f, -2.0f, -2.0f |
| 3844 | }; |
| 3845 | std::vector<float> alphaData |
| 3846 | { |
| 3847 | // Expected quantized values: |
| 3848 | // 50, 54, 58 |
| 3849 | 0.0f, 1.0f, 2.0f |
| 3850 | }; |
| 3851 | std::vector<float> outputExpectedData = |
| 3852 | { |
| 3853 | // Expected quantized values: |
| 3854 | // 20, 120, 120, 122, 122, 122, 120, 118, 116, 120, 116, 112 |
| 3855 | 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, -2.0f, 0.0f, -2.0f, -4.0f |
| 3856 | }; |
| 3857 | |
| 3858 | auto input = MakeTensor<T, 4>(inputTensorInfo, QuantizedVector<T>(inputTensorInfo.GetQuantizationScale(), |
| 3859 | inputTensorInfo.GetQuantizationOffset(), |
| 3860 | inputData)); |
| 3861 | auto alpha = MakeTensor<T, 4>(alphaTensorInfo, QuantizedVector<T>(alphaTensorInfo.GetQuantizationScale(), |
| 3862 | alphaTensorInfo.GetQuantizationOffset(), |
| 3863 | alphaData)); |
| 3864 | |
| 3865 | LayerTestResult<T, 4> result(outputTensorInfo); |
| 3866 | result.outputExpected = MakeTensor<T, 4>(outputTensorInfo, |
| 3867 | QuantizedVector<T>(outputTensorInfo.GetQuantizationScale(), |
| 3868 | outputTensorInfo.GetQuantizationOffset(), |
| 3869 | outputExpectedData)); |
| 3870 | |
| 3871 | std::unique_ptr <armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3872 | std::unique_ptr <armnn::ITensorHandle> alphaHandle = workloadFactory.CreateTensorHandle(alphaTensorInfo); |
| 3873 | std::unique_ptr <armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3874 | |
| 3875 | armnn::PreluQueueDescriptor descriptor; |
| 3876 | armnn::WorkloadInfo info; |
| 3877 | AddInputToWorkload (descriptor, info, inputTensorInfo, inputHandle.get()); |
| 3878 | AddInputToWorkload (descriptor, info, alphaTensorInfo, alphaHandle.get()); |
| 3879 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 3880 | |
| 3881 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreatePrelu(descriptor, info); |
| 3882 | |
| 3883 | inputHandle->Allocate(); |
| 3884 | alphaHandle->Allocate(); |
| 3885 | outputHandle->Allocate(); |
| 3886 | |
| 3887 | CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); |
| 3888 | CopyDataToITensorHandle(alphaHandle.get(), &alpha[0][0][0][0]); |
| 3889 | |
| 3890 | workload->Execute(); |
| 3891 | |
| 3892 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3893 | |
| 3894 | return result; |
| 3895 | } |
| 3896 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 3897 | template<armnn::DataType ArmnnType, |
| 3898 | std::size_t InputDim, |
| 3899 | std::size_t OutputDim, |
| 3900 | typename T = armnn::ResolveType<ArmnnType>> |
| 3901 | LayerTestResult<T, OutputDim> BatchToSpaceNdHelper( |
| 3902 | armnn::IWorkloadFactory &workloadFactory, |
| 3903 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 3904 | const armnn::DataLayout& dataLayout, |
| 3905 | const unsigned int *inputShape, |
| 3906 | const std::vector<float> &inputData, |
| 3907 | const std::vector<unsigned int> &blockShape, |
| 3908 | const std::vector<std::pair<unsigned int, unsigned int>> &crops, |
| 3909 | const unsigned int *outputShape, |
| 3910 | const std::vector<float> &outputData, |
| 3911 | float scale = 1.0f, |
| 3912 | int32_t offset = 0) |
| 3913 | { |
| 3914 | armnn::TensorInfo inputTensorInfo(InputDim, inputShape, ArmnnType); |
| 3915 | armnn::TensorInfo outputTensorInfo(OutputDim, outputShape, ArmnnType); |
| 3916 | |
| 3917 | inputTensorInfo.SetQuantizationScale(scale); |
| 3918 | inputTensorInfo.SetQuantizationOffset(offset); |
| 3919 | |
| 3920 | outputTensorInfo.SetQuantizationScale(scale); |
| 3921 | outputTensorInfo.SetQuantizationOffset(offset); |
Francis Murtagh | d0dfe17 | 2019-06-25 10:57:10 +0100 | [diff] [blame] | 3922 | |
Francis Murtagh | 57f13d5 | 2019-06-24 14:24:36 +0100 | [diff] [blame] | 3923 | auto input = MakeTensor<T, InputDim>(inputTensorInfo, ConvertToDataType<ArmnnType>(inputData, inputTensorInfo)); |
| 3924 | |
| 3925 | LayerTestResult<T, OutputDim> result(outputTensorInfo); |
| 3926 | result.outputExpected = MakeTensor<T, OutputDim>(outputTensorInfo, |
| 3927 | ConvertToDataType<ArmnnType>(outputData, outputTensorInfo)); |
| 3928 | |
| 3929 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 3930 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 3931 | |
| 3932 | armnn::BatchToSpaceNdQueueDescriptor data; |
| 3933 | data.m_Parameters.m_DataLayout = dataLayout; |
| 3934 | data.m_Parameters.m_BlockShape = blockShape; |
| 3935 | data.m_Parameters.m_Crops = crops; |
| 3936 | armnn::WorkloadInfo info; |
| 3937 | AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); |
| 3938 | AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); |
| 3939 | |
| 3940 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateBatchToSpaceNd(data, info); |
| 3941 | |
| 3942 | inputHandle->Allocate(); |
| 3943 | outputHandle->Allocate(); |
| 3944 | |
| 3945 | CopyDataToITensorHandle(inputHandle.get(), input.origin()); |
| 3946 | |
| 3947 | workload->PostAllocationConfigure(); |
| 3948 | workload->Execute(); |
| 3949 | |
| 3950 | CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); |
| 3951 | |
| 3952 | return result; |
| 3953 | } |
| 3954 | |
| 3955 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 3956 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest1( |
| 3957 | armnn::IWorkloadFactory& workloadFactory, |
| 3958 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 3959 | { |
| 3960 | const unsigned int inputShape[] = {4, 2, 2, 1}; |
| 3961 | const unsigned int outputShape[] = {1, 4, 4, 1}; |
| 3962 | |
| 3963 | std::vector<float> input({ |
| 3964 | // Batch 0, Height 0, Width (2) x Channel (1) |
| 3965 | 1.0f, 3.0f, |
| 3966 | // Batch 0, Height 1, Width (2) x Channel (1) |
| 3967 | 9.0f, 11.0f, |
| 3968 | |
| 3969 | |
| 3970 | // Batch 1, Height 0, Width (2) x Channel (1) |
| 3971 | 2.0f, 4.0f, |
| 3972 | // Batch 1, Height 1, Width (2) x Channel (1) |
| 3973 | 10.0f, 12.0f, |
| 3974 | |
| 3975 | |
| 3976 | // Batch 2, Height 0, Width (2) x Channel (1) |
| 3977 | 5.0f, 7.0f, |
| 3978 | // Batch 2, Height 1, Width (2) x Channel (1) |
| 3979 | 13.0f, 15.0f, |
| 3980 | |
| 3981 | // Batch 3, Height 0, Width (2) x Channel (3) |
| 3982 | 6.0f, 8.0f, |
| 3983 | // Batch 3, Height 1, Width (2) x Channel (1) |
| 3984 | 14.0f, 16.0f |
| 3985 | }); |
| 3986 | |
| 3987 | std::vector<float> expectedOutput({ |
| 3988 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 3989 | 5.0f, 6.0f, 7.0f, 8.0f, |
| 3990 | 9.0f, 10.0f, 11.0f, 12.0f, |
| 3991 | 13.0f, 14.0f, 15.0f, 16.0f |
| 3992 | }); |
| 3993 | |
| 3994 | std::vector<unsigned int> blockShape {2, 2}; |
| 3995 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 3996 | |
| 3997 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 3998 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 3999 | crops, outputShape, expectedOutput); |
| 4000 | } |
| 4001 | |
| 4002 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4003 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest2( |
| 4004 | armnn::IWorkloadFactory& workloadFactory, |
| 4005 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4006 | { |
| 4007 | const unsigned int inputShape[] = {4, 1, 1, 1}; |
| 4008 | const unsigned int outputShape[] = {1, 2, 2, 1}; |
| 4009 | |
| 4010 | std::vector<float> input({ |
| 4011 | // Batch 0, Height 0, Width (2) x Channel (1) |
| 4012 | 1.0f, 2.0f, 3.0f, 4.0f |
| 4013 | }); |
| 4014 | |
| 4015 | std::vector<float> expectedOutput({1.0f, 2.0f, 3.0f, 4.0f}); |
| 4016 | |
| 4017 | std::vector<unsigned int> blockShape({2, 2}); |
| 4018 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4019 | |
| 4020 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4021 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 4022 | crops, outputShape, expectedOutput); |
| 4023 | } |
| 4024 | |
| 4025 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4026 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest3( |
| 4027 | armnn::IWorkloadFactory& workloadFactory, |
| 4028 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4029 | { |
| 4030 | const unsigned int inputShape[] = {4, 1, 1, 3}; |
| 4031 | const unsigned int outputShape[] = {1, 2, 2, 3}; |
| 4032 | |
| 4033 | std::vector<float> input({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}); |
| 4034 | |
| 4035 | std::vector<float> expectedOutput({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}); |
| 4036 | |
| 4037 | std::vector<unsigned int> blockShape({2, 2}); |
| 4038 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4039 | |
| 4040 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4041 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 4042 | crops, outputShape, expectedOutput); |
| 4043 | } |
| 4044 | |
| 4045 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4046 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest4( |
| 4047 | armnn::IWorkloadFactory& workloadFactory, |
| 4048 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4049 | { |
| 4050 | const unsigned int inputShape[] = {8, 1, 3, 1}; |
| 4051 | const unsigned int outputShape[] = {2, 2, 4, 1}; |
| 4052 | |
| 4053 | std::vector<float> input({ |
| 4054 | 0.0f, 1.0f, 3.0f, |
| 4055 | 0.0f, 9.0f, 11.0f, |
| 4056 | 0.0f, 2.0f, 4.0f, |
| 4057 | 0.0f, 10.0f, 12.0f, |
| 4058 | 0.0f, 5.0f, 7.0f, |
| 4059 | 0.0f, 13.0f, 15.0f, |
| 4060 | 0.0f, 6.0f, 8.0f, |
| 4061 | 0.0f, 14.0f, 16.0f |
| 4062 | }); |
| 4063 | |
| 4064 | std::vector<float> expectedOutput({ |
| 4065 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 4066 | 5.0f, 6.0f, 7.0f, 8.0f, |
| 4067 | 9.0f, 10.0f, 11.0f, 12.0f, |
| 4068 | 13.0f, 14.0f, 15.0f, 16.0f |
| 4069 | }); |
| 4070 | |
| 4071 | std::vector<unsigned int> blockShape({2, 2}); |
| 4072 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {2, 0}}; |
| 4073 | |
| 4074 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4075 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 4076 | crops, outputShape, expectedOutput); |
| 4077 | } |
| 4078 | |
| 4079 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4080 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest5( |
| 4081 | armnn::IWorkloadFactory& workloadFactory, |
| 4082 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4083 | { |
| 4084 | const unsigned int inputShape[] = {4, 2, 2, 1}; |
| 4085 | const unsigned int outputShape[] = {1, 4, 4, 1}; |
| 4086 | |
| 4087 | std::vector<float> input({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}); |
| 4088 | std::vector<float> expectedOutput({1, 5, 2, 6, 9, 13, 10, 14, 3, 7, 4, 8, 11, 15, 12, 16}); |
| 4089 | |
| 4090 | std::vector<unsigned int> blockShape({2, 2}); |
| 4091 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4092 | |
| 4093 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, armnn::DataLayout::NHWC, inputShape, |
| 4094 | input, blockShape, crops, outputShape, expectedOutput); |
| 4095 | } |
| 4096 | |
| 4097 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4098 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest6( |
| 4099 | armnn::IWorkloadFactory& workloadFactory, |
| 4100 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4101 | { |
| 4102 | const unsigned int inputShape[] = {4, 1, 1, 1}; |
| 4103 | const unsigned int outputShape[] = {1, 2, 2, 1}; |
| 4104 | |
| 4105 | std::vector<float> input({ |
| 4106 | // Batch 0, Height 0, Width (2) x Channel (1) |
| 4107 | 1, 2, 3, 4 |
| 4108 | }); |
| 4109 | |
| 4110 | std::vector<float> expectedOutput({1, 2, 3, 4}); |
| 4111 | |
| 4112 | std::vector<unsigned int> blockShape({2, 2}); |
| 4113 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4114 | |
| 4115 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4116 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 4117 | crops, outputShape, expectedOutput); |
| 4118 | } |
| 4119 | |
| 4120 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4121 | LayerTestResult<T, 4> BatchToSpaceNdNhwcTest7( |
| 4122 | armnn::IWorkloadFactory& workloadFactory, |
| 4123 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4124 | { |
| 4125 | const unsigned int inputShape[] = {4, 1, 1, 3}; |
| 4126 | const unsigned int outputShape[] = {1, 2, 2, 3}; |
| 4127 | |
| 4128 | std::vector<float> input({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); |
| 4129 | |
| 4130 | std::vector<float> expectedOutput({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); |
| 4131 | |
| 4132 | std::vector<unsigned int> blockShape({2, 2}); |
| 4133 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4134 | |
| 4135 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4136 | armnn::DataLayout::NHWC, inputShape, input, blockShape, |
| 4137 | crops, outputShape, expectedOutput); |
| 4138 | } |
| 4139 | |
| 4140 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4141 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest1( |
| 4142 | armnn::IWorkloadFactory &workloadFactory, |
| 4143 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4144 | { |
| 4145 | const unsigned int inputShape[] = {4, 3, 1, 1}; |
| 4146 | const unsigned int outputShape[] = {1, 3, 2, 2}; |
| 4147 | |
| 4148 | std::vector<float> input({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}); |
| 4149 | |
| 4150 | std::vector<float> expectedOutput({ |
| 4151 | // Batch 0, Channel 0, Height (2) x Width (2) |
| 4152 | 1.0f, 4.0f, |
| 4153 | 7.0f, 10.0f, |
| 4154 | |
| 4155 | // Batch 0, Channel 1, Height (2) x Width (2) |
| 4156 | 2.0f, 5.0f, |
| 4157 | 8.0f, 11.0f, |
| 4158 | |
| 4159 | // Batch 0, Channel 2, Height (2) x Width (2) |
| 4160 | 3.0f, 6.0f, |
| 4161 | 9.0f, 12.0f, |
| 4162 | }); |
| 4163 | |
| 4164 | std::vector<unsigned int> blockShape({2, 2}); |
| 4165 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4166 | |
| 4167 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4168 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4169 | crops, outputShape, expectedOutput); |
| 4170 | } |
| 4171 | |
| 4172 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4173 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest2( |
| 4174 | armnn::IWorkloadFactory& workloadFactory, |
| 4175 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4176 | { |
| 4177 | const unsigned int inputShape[] = {4, 1, 1, 1}; |
| 4178 | const unsigned int outputShape[] = {1, 1, 2, 2}; |
| 4179 | |
| 4180 | std::vector<float> input({ |
| 4181 | // Batch 0, Height 0, Width (2) x Channel (1) |
| 4182 | 1.0f, 2.0f, 3.0f, 4.0f |
| 4183 | }); |
| 4184 | |
| 4185 | std::vector<float> expectedOutput({1.0f, 2.0f, 3.0f, 4.0f}); |
| 4186 | |
| 4187 | std::vector<unsigned int> blockShape({2, 2}); |
| 4188 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4189 | |
| 4190 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4191 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4192 | crops, outputShape, expectedOutput); |
| 4193 | } |
| 4194 | |
| 4195 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4196 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest3( |
| 4197 | armnn::IWorkloadFactory& workloadFactory, |
| 4198 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4199 | { |
| 4200 | const unsigned int inputShape[] = {4, 3, 1, 1}; |
| 4201 | const unsigned int outputShape[] = {1, 3, 2, 2}; |
| 4202 | |
| 4203 | std::vector<float> input({1.0f, 3.0f, 5.0f, 7.0f, 9.0f, 11.0f, 2.0f, 4.0f, 6.0f, 8.0f, 10.0f, 12.0f}); |
| 4204 | |
| 4205 | std::vector<float> expectedOutput({ |
| 4206 | // Batch 0, Channel 0, Height (2) x Width (2) |
| 4207 | 1.0f, 7.0f, |
| 4208 | 2.0f, 8.0f, |
| 4209 | |
| 4210 | // Batch 0, Channel 1, Height (2) x Width (2) |
| 4211 | 3.0f, 9.0f, |
| 4212 | 4.0f, 10.0f, |
| 4213 | |
| 4214 | // Batch 0, Channel 2, Height (2) x Width (2) |
| 4215 | 5.0f, 11.0f, |
| 4216 | 6.0f, 12.0f, |
| 4217 | }); |
| 4218 | |
| 4219 | std::vector<unsigned int> blockShape({2, 2}); |
| 4220 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4221 | |
| 4222 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4223 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4224 | crops, outputShape, expectedOutput); |
| 4225 | } |
| 4226 | |
| 4227 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4228 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest4( |
| 4229 | armnn::IWorkloadFactory &workloadFactory, |
| 4230 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4231 | { |
| 4232 | const unsigned int inputShape[] = {4, 3, 1, 1}; |
| 4233 | const unsigned int outputShape[] = {1, 3, 2, 2}; |
| 4234 | |
| 4235 | std::vector<float> input({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); |
| 4236 | |
| 4237 | std::vector<float> expectedOutput({ |
| 4238 | // Batch 0, Channel 0, Height (2) x Width (2) |
| 4239 | 1, 4, |
| 4240 | 7, 10, |
| 4241 | |
| 4242 | // Batch 0, Channel 1, Height (2) x Width (2) |
| 4243 | 2, 5, |
| 4244 | 8, 11, |
| 4245 | |
| 4246 | // Batch 0, Channel 2, Height (2) x Width (2) |
| 4247 | 3, 6, |
| 4248 | 9, 12, |
| 4249 | }); |
| 4250 | |
| 4251 | std::vector<unsigned int> blockShape({2, 2}); |
| 4252 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4253 | |
| 4254 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4255 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4256 | crops, outputShape, expectedOutput); |
| 4257 | } |
| 4258 | |
| 4259 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4260 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest5( |
| 4261 | armnn::IWorkloadFactory& workloadFactory, |
| 4262 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4263 | { |
| 4264 | const unsigned int inputShape[] = {4, 1, 1, 1}; |
| 4265 | const unsigned int outputShape[] = {1, 1, 2, 2}; |
| 4266 | |
| 4267 | std::vector<float> input({ |
| 4268 | // Batch 0, Height 0, Width (2) x Channel (1) |
| 4269 | 1, 2, 3, 4 |
| 4270 | }); |
| 4271 | |
| 4272 | std::vector<float> expectedOutput({1, 2, 3, 4}); |
| 4273 | |
| 4274 | std::vector<unsigned int> blockShape({2, 2}); |
| 4275 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4276 | |
| 4277 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4278 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4279 | crops, outputShape, expectedOutput); |
| 4280 | } |
| 4281 | |
| 4282 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4283 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest6( |
| 4284 | armnn::IWorkloadFactory& workloadFactory, |
| 4285 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4286 | { |
| 4287 | const unsigned int inputShape[] = {4, 3, 1, 1}; |
| 4288 | const unsigned int outputShape[] = {1, 3, 2, 2}; |
| 4289 | |
| 4290 | std::vector<float> input({1, 3, 5, 7, 9, 11, 2, 4, 6, 8, 10, 12}); |
| 4291 | |
| 4292 | std::vector<float> expectedOutput({ |
| 4293 | // Batch 0, Channel 0, Height (2) x Width (2) |
| 4294 | 1, 7, |
| 4295 | 2, 8, |
| 4296 | |
| 4297 | // Batch 0, Channel 1, Height (2) x Width (2) |
| 4298 | 3, 9, |
| 4299 | 4, 10, |
| 4300 | |
| 4301 | // Batch 0, Channel 2, Height (2) x Width (2) |
| 4302 | 5, 11, |
| 4303 | 6, 12, |
| 4304 | }); |
| 4305 | |
| 4306 | std::vector<unsigned int> blockShape({2, 2}); |
| 4307 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}}; |
| 4308 | |
| 4309 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4310 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4311 | crops, outputShape, expectedOutput); |
| 4312 | } |
| 4313 | |
| 4314 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4315 | LayerTestResult<T, 4> BatchToSpaceNdNchwTest7( |
| 4316 | armnn::IWorkloadFactory& workloadFactory, |
| 4317 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4318 | { |
| 4319 | const unsigned int inputShape[] = {8, 1, 1, 3}; |
| 4320 | const unsigned int outputShape[] = {2, 1, 2, 4}; |
| 4321 | |
| 4322 | std::vector<float> input({ |
| 4323 | 0, 1, 3, 0, 9, 11, |
| 4324 | 0, 2, 4, 0, 10, 12, |
| 4325 | 0, 5, 7, 0, 13, 15, |
| 4326 | 0, 6, 8, 0, 14, 16 |
| 4327 | }); |
| 4328 | |
| 4329 | std::vector<float> expectedOutput({ |
| 4330 | 1, 2, 3, 4, |
| 4331 | 5, 6, 7, 8, |
| 4332 | 9, 10, 11, 12, |
| 4333 | 13, 14, 15, 16 |
| 4334 | }); |
| 4335 | |
| 4336 | std::vector<unsigned int> blockShape({2, 2}); |
| 4337 | std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {2, 0}}; |
| 4338 | |
| 4339 | return BatchToSpaceNdHelper<ArmnnType, 4, 4>(workloadFactory, memoryManager, |
| 4340 | armnn::DataLayout::NCHW, inputShape, input, blockShape, |
| 4341 | crops, outputShape, expectedOutput); |
| 4342 | } |
| 4343 | |
Matteo Martincigh | ab9e525 | 2019-06-13 17:27:46 +0100 | [diff] [blame] | 4344 | template LayerTestResult<typename armnn::ResolveType<armnn::DataType::Float32>, 4> |
| 4345 | PreluTest<armnn::DataType::Float32>( |
| 4346 | armnn::IWorkloadFactory& workloadFactory, |
| 4347 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4348 | |
| 4349 | template LayerTestResult<typename armnn::ResolveType<armnn::DataType::QuantisedAsymm8>, 4> |
| 4350 | PreluTest<armnn::DataType::QuantisedAsymm8>( |
| 4351 | armnn::IWorkloadFactory& workloadFactory, |
| 4352 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4353 | |
| 4354 | template LayerTestResult<typename armnn::ResolveType<armnn::DataType::QuantisedSymm16>, 4> |
| 4355 | PreluTest<armnn::DataType::QuantisedSymm16>( |
| 4356 | armnn::IWorkloadFactory& workloadFactory, |
| 4357 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Aron Virginas-Tar | 735a450 | 2019-06-26 15:02:47 +0100 | [diff] [blame] | 4358 | |
| 4359 | // |
| 4360 | // TransposeConvolution2d |
| 4361 | // |
| 4362 | |
| 4363 | // Simple biased |
| 4364 | LayerTestResult<float, 4> SimpleTransposeConvolution2dFloatNchwTest( |
| 4365 | armnn::IWorkloadFactory& workloadFactory, |
| 4366 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4367 | |
| 4368 | LayerTestResult<float, 4> SimpleTransposeConvolution2dFloatNhwcTest( |
| 4369 | armnn::IWorkloadFactory& workloadFactory, |
| 4370 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4371 | |
| 4372 | LayerTestResult<uint8_t, 4> SimpleTransposeConvolution2dUint8NchwTest( |
| 4373 | armnn::IWorkloadFactory& workloadFactory, |
| 4374 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4375 | |
| 4376 | LayerTestResult<uint8_t, 4> SimpleTransposeConvolution2dUint8NhwcTest( |
| 4377 | armnn::IWorkloadFactory& workloadFactory, |
| 4378 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4379 | |
| 4380 | LayerTestResult<int16_t, 4> SimpleTransposeConvolution2dInt16NchwTest( |
| 4381 | armnn::IWorkloadFactory& workloadFactory, |
| 4382 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4383 | |
| 4384 | LayerTestResult<int16_t, 4> SimpleTransposeConvolution2dInt16NhwcTest( |
| 4385 | armnn::IWorkloadFactory& workloadFactory, |
| 4386 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4387 | |
| 4388 | // Simple unbiased |
| 4389 | LayerTestResult<float, 4> UnbiasedSimpleTransposeConvolution2dFloatNchwTest( |
| 4390 | armnn::IWorkloadFactory& workloadFactory, |
| 4391 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4392 | |
| 4393 | LayerTestResult<float, 4> UnbiasedSimpleTransposeConvolution2dFloatNhwcTest( |
| 4394 | armnn::IWorkloadFactory& workloadFactory, |
| 4395 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4396 | |
| 4397 | LayerTestResult<uint8_t, 4> UnbiasedSimpleTransposeConvolution2dUint8NchwTest( |
| 4398 | armnn::IWorkloadFactory& workloadFactory, |
| 4399 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4400 | |
| 4401 | LayerTestResult<uint8_t, 4> UnbiasedSimpleTransposeConvolution2dUint8NhwcTest( |
| 4402 | armnn::IWorkloadFactory& workloadFactory, |
| 4403 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4404 | |
| 4405 | LayerTestResult<int16_t, 4> UnbiasedSimpleTransposeConvolution2dInt16NchwTest( |
| 4406 | armnn::IWorkloadFactory& workloadFactory, |
| 4407 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4408 | |
| 4409 | LayerTestResult<int16_t, 4> UnbiasedSimpleTransposeConvolution2dInt16NhwcTest( |
| 4410 | armnn::IWorkloadFactory& workloadFactory, |
| 4411 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4412 | |
| 4413 | // Padded biased |
| 4414 | LayerTestResult<float, 4> PaddedTransposeConvolution2dFloatNchwTest( |
| 4415 | armnn::IWorkloadFactory& workloadFactory, |
| 4416 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4417 | |
| 4418 | LayerTestResult<float, 4> PaddedTransposeConvolution2dFloatNhwcTest( |
| 4419 | armnn::IWorkloadFactory& workloadFactory, |
| 4420 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4421 | |
| 4422 | LayerTestResult<uint8_t, 4> PaddedTransposeConvolution2dUint8NchwTest( |
| 4423 | armnn::IWorkloadFactory& workloadFactory, |
| 4424 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4425 | |
| 4426 | LayerTestResult<uint8_t, 4> PaddedTransposeConvolution2dUint8NhwcTest( |
| 4427 | armnn::IWorkloadFactory& workloadFactory, |
| 4428 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4429 | |
| 4430 | LayerTestResult<int16_t, 4> PaddedTransposeConvolution2dInt16NchwTest( |
| 4431 | armnn::IWorkloadFactory& workloadFactory, |
| 4432 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4433 | |
| 4434 | LayerTestResult<int16_t, 4> PaddedTransposeConvolution2dInt16NhwcTest( |
| 4435 | armnn::IWorkloadFactory& workloadFactory, |
| 4436 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4437 | |
| 4438 | // Padded unbiased |
| 4439 | LayerTestResult<float, 4> UnbiasedPaddedTransposeConvolution2dFloatNchwTest( |
| 4440 | armnn::IWorkloadFactory& workloadFactory, |
| 4441 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4442 | |
| 4443 | LayerTestResult<float, 4> UnbiasedPaddedTransposeConvolution2dFloatNhwcTest( |
| 4444 | armnn::IWorkloadFactory& workloadFactory, |
| 4445 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4446 | |
| 4447 | LayerTestResult<uint8_t, 4> UnbiasedPaddedTransposeConvolution2dUint8NchwTest( |
| 4448 | armnn::IWorkloadFactory& workloadFactory, |
| 4449 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4450 | |
| 4451 | LayerTestResult<uint8_t, 4> UnbiasedPaddedTransposeConvolution2dUint8NhwcTest( |
| 4452 | armnn::IWorkloadFactory& workloadFactory, |
| 4453 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4454 | |
| 4455 | LayerTestResult<int16_t, 4> UnbiasedPaddedTransposeConvolution2dInt16NchwTest( |
| 4456 | armnn::IWorkloadFactory& workloadFactory, |
| 4457 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4458 | |
| 4459 | LayerTestResult<int16_t, 4> UnbiasedPaddedTransposeConvolution2dInt16NhwcTest( |
| 4460 | armnn::IWorkloadFactory& workloadFactory, |
| 4461 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4462 | |
| 4463 | // Strided biased |
| 4464 | LayerTestResult<float, 4> StridedTransposeConvolution2dFloatNchwTest( |
| 4465 | armnn::IWorkloadFactory& workloadFactory, |
| 4466 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4467 | |
| 4468 | LayerTestResult<float, 4> StridedTransposeConvolution2dFloatNhwcTest( |
| 4469 | armnn::IWorkloadFactory& workloadFactory, |
| 4470 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4471 | |
| 4472 | LayerTestResult<uint8_t, 4> StridedTransposeConvolution2dUint8NchwTest( |
| 4473 | armnn::IWorkloadFactory& workloadFactory, |
| 4474 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4475 | |
| 4476 | LayerTestResult<uint8_t, 4> StridedTransposeConvolution2dUint8NhwcTest( |
| 4477 | armnn::IWorkloadFactory& workloadFactory, |
| 4478 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4479 | |
| 4480 | LayerTestResult<int16_t, 4> StridedTransposeConvolution2dInt16NchwTest( |
| 4481 | armnn::IWorkloadFactory& workloadFactory, |
| 4482 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4483 | |
| 4484 | LayerTestResult<int16_t, 4> StridedTransposeConvolution2dInt16NhwcTest( |
| 4485 | armnn::IWorkloadFactory& workloadFactory, |
| 4486 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4487 | |
| 4488 | // Strided unbiased |
| 4489 | LayerTestResult<float, 4> UnbiasedStridedTransposeConvolution2dFloatNchwTest( |
| 4490 | armnn::IWorkloadFactory& workloadFactory, |
| 4491 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4492 | |
| 4493 | LayerTestResult<float, 4> UnbiasedStridedTransposeConvolution2dFloatNhwcTest( |
| 4494 | armnn::IWorkloadFactory& workloadFactory, |
| 4495 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4496 | |
| 4497 | LayerTestResult<uint8_t, 4> UnbiasedStridedTransposeConvolution2dUint8NchwTest( |
| 4498 | armnn::IWorkloadFactory& workloadFactory, |
| 4499 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4500 | |
| 4501 | LayerTestResult<uint8_t, 4> UnbiasedStridedTransposeConvolution2dUint8NhwcTest( |
| 4502 | armnn::IWorkloadFactory& workloadFactory, |
| 4503 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4504 | |
| 4505 | LayerTestResult<int16_t, 4> UnbiasedStridedTransposeConvolution2dInt16NchwTest( |
| 4506 | armnn::IWorkloadFactory& workloadFactory, |
| 4507 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 4508 | |
| 4509 | LayerTestResult<int16_t, 4> UnbiasedStridedTransposeConvolution2dInt16NhwcTest( |
| 4510 | armnn::IWorkloadFactory& workloadFactory, |
Narumol Prangnawarat | e6eaf66 | 2019-07-08 08:57:17 +0100 | [diff] [blame] | 4511 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
Matthew Jackson | 81e601c | 2019-07-11 12:07:09 +0100 | [diff] [blame] | 4512 | |
| 4513 | template<armnn::DataType ArmnnType, typename T, std::size_t outputDimLength> |
| 4514 | LayerTestResult<T, outputDimLength> StackTestHelper( |
| 4515 | armnn::IWorkloadFactory& workloadFactory, |
| 4516 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 4517 | const armnn::TensorInfo& inputTensorInfo, |
| 4518 | const armnn::TensorInfo& outputTensorInfo, |
| 4519 | unsigned int axis, |
| 4520 | const std::vector<std::vector<T>>& inputData, |
| 4521 | const std::vector<T>& outputExpectedData) |
| 4522 | { |
| 4523 | unsigned int numInputs = static_cast<unsigned int>(inputData.size()); |
| 4524 | std::vector<boost::multi_array<T, outputDimLength-1>> inputs; |
| 4525 | for (unsigned int i = 0; i < numInputs; ++i) |
| 4526 | { |
| 4527 | inputs.push_back(MakeTensor<T, outputDimLength-1>(inputTensorInfo, inputData[i])); |
| 4528 | } |
| 4529 | |
| 4530 | LayerTestResult<T, outputDimLength> result(outputTensorInfo); |
| 4531 | result.outputExpected = MakeTensor<T, outputDimLength>(outputTensorInfo, outputExpectedData); |
| 4532 | |
| 4533 | std::vector<std::unique_ptr<armnn::ITensorHandle>> inputHandles; |
| 4534 | for (unsigned int i = 0; i < numInputs; ++i) |
| 4535 | { |
| 4536 | inputHandles.push_back(workloadFactory.CreateTensorHandle(inputTensorInfo)); |
| 4537 | } |
| 4538 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 4539 | |
| 4540 | armnn::StackQueueDescriptor descriptor; |
| 4541 | descriptor.m_Parameters.m_Axis = axis; |
| 4542 | descriptor.m_Parameters.m_InputShape = inputTensorInfo.GetShape(); |
| 4543 | descriptor.m_Parameters.m_NumInputs = numInputs; |
| 4544 | |
| 4545 | armnn::WorkloadInfo info; |
| 4546 | for (unsigned int i = 0; i < numInputs; ++i) |
| 4547 | { |
| 4548 | std::unique_ptr<armnn::ITensorHandle>& inputHandle = inputHandles[i]; |
| 4549 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 4550 | inputHandle->Allocate(); |
| 4551 | CopyDataToITensorHandle(inputHandle.get(), inputs[i].origin()); |
| 4552 | } |
| 4553 | |
| 4554 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 4555 | outputHandle->Allocate(); |
| 4556 | |
| 4557 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateStack(descriptor, info); |
| 4558 | |
| 4559 | workload->Execute(); |
| 4560 | |
| 4561 | CopyDataFromITensorHandle(result.output.origin(), outputHandle.get()); |
| 4562 | |
| 4563 | return result; |
| 4564 | } |
| 4565 | |
| 4566 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4567 | LayerTestResult<T, 4> Stack0AxisTest( |
| 4568 | armnn::IWorkloadFactory& workloadFactory, |
| 4569 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4570 | { |
| 4571 | armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType); |
| 4572 | armnn::TensorInfo outputTensorInfo({ 2, 3, 2, 3 }, ArmnnType); |
| 4573 | |
| 4574 | std::vector<std::vector<T>> inputData; |
| 4575 | |
| 4576 | inputData.push_back( |
| 4577 | { |
| 4578 | 1, 2, 3, |
| 4579 | 4, 5, 6, |
| 4580 | |
| 4581 | 7, 8, 9, |
| 4582 | 10, 11, 12, |
| 4583 | |
| 4584 | 13, 14, 15, |
| 4585 | 16, 17, 18 |
| 4586 | }); |
| 4587 | |
| 4588 | inputData.push_back( |
| 4589 | { |
| 4590 | 19, 20, 21, |
| 4591 | 22, 23, 24, |
| 4592 | |
| 4593 | 25, 26, 27, |
| 4594 | 28, 29, 30, |
| 4595 | |
| 4596 | 31, 32, 33, |
| 4597 | 34, 35, 36 |
| 4598 | }); |
| 4599 | |
| 4600 | std::vector<T> outputExpectedData = |
| 4601 | { |
| 4602 | 1, 2, 3, |
| 4603 | 4, 5, 6, |
| 4604 | |
| 4605 | 7, 8, 9, |
| 4606 | 10, 11, 12, |
| 4607 | |
| 4608 | 13, 14, 15, |
| 4609 | 16, 17, 18, |
| 4610 | |
| 4611 | |
| 4612 | 19, 20, 21, |
| 4613 | 22, 23, 24, |
| 4614 | |
| 4615 | 25, 26, 27, |
| 4616 | 28, 29, 30, |
| 4617 | |
| 4618 | 31, 32, 33, |
| 4619 | 34, 35, 36 |
| 4620 | }; |
| 4621 | |
| 4622 | return StackTestHelper<ArmnnType, T, 4>( |
| 4623 | workloadFactory, |
| 4624 | memoryManager, |
| 4625 | inputTensorInfo, |
| 4626 | outputTensorInfo, |
| 4627 | 0U, |
| 4628 | inputData, |
| 4629 | outputExpectedData |
| 4630 | ); |
| 4631 | } |
| 4632 | |
| 4633 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4634 | LayerTestResult<T, 4> Stack4dOutput1AxisTest( |
| 4635 | armnn::IWorkloadFactory& workloadFactory, |
| 4636 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4637 | { |
| 4638 | armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType); |
| 4639 | armnn::TensorInfo outputTensorInfo({ 3, 2, 2, 3 }, ArmnnType); |
| 4640 | |
| 4641 | std::vector<std::vector<T>> inputData; |
| 4642 | |
| 4643 | inputData.push_back( |
| 4644 | { |
| 4645 | 1, 2, 3, |
| 4646 | 4, 5, 6, |
| 4647 | |
| 4648 | 7, 8, 9, |
| 4649 | 10, 11, 12, |
| 4650 | |
| 4651 | 13, 14, 15, |
| 4652 | 16, 17, 18 |
| 4653 | }); |
| 4654 | |
| 4655 | inputData.push_back( |
| 4656 | { |
| 4657 | 19, 20, 21, |
| 4658 | 22, 23, 24, |
| 4659 | |
| 4660 | 25, 26, 27, |
| 4661 | 28, 29, 30, |
| 4662 | |
| 4663 | 31, 32, 33, |
| 4664 | 34, 35, 36 |
| 4665 | }); |
| 4666 | |
| 4667 | std::vector<T> outputExpectedData = |
| 4668 | { |
| 4669 | 1, 2, 3, |
| 4670 | 4, 5, 6, |
| 4671 | |
| 4672 | 19, 20, 21, |
| 4673 | 22, 23, 24, |
| 4674 | |
| 4675 | |
| 4676 | 7, 8, 9, |
| 4677 | 10, 11, 12, |
| 4678 | |
| 4679 | 25, 26, 27, |
| 4680 | 28, 29, 30, |
| 4681 | |
| 4682 | |
| 4683 | 13, 14, 15, |
| 4684 | 16, 17, 18, |
| 4685 | |
| 4686 | 31, 32, 33, |
| 4687 | 34, 35, 36 |
| 4688 | }; |
| 4689 | |
| 4690 | return StackTestHelper<ArmnnType, T, 4>( |
| 4691 | workloadFactory, |
| 4692 | memoryManager, |
| 4693 | inputTensorInfo, |
| 4694 | outputTensorInfo, |
| 4695 | 1U, |
| 4696 | inputData, |
| 4697 | outputExpectedData |
| 4698 | ); |
| 4699 | } |
| 4700 | |
| 4701 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4702 | LayerTestResult<T, 4> Stack4dOutput2AxisTest( |
| 4703 | armnn::IWorkloadFactory& workloadFactory, |
| 4704 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4705 | { |
| 4706 | armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType); |
| 4707 | armnn::TensorInfo outputTensorInfo({ 3, 2, 2, 3 }, ArmnnType); |
| 4708 | |
| 4709 | std::vector<std::vector<T>> inputData; |
| 4710 | |
| 4711 | inputData.push_back( |
| 4712 | { |
| 4713 | 1, 2, 3, |
| 4714 | 4, 5, 6, |
| 4715 | |
| 4716 | 7, 8, 9, |
| 4717 | 10, 11, 12, |
| 4718 | |
| 4719 | 13, 14, 15, |
| 4720 | 16, 17, 18 |
| 4721 | }); |
| 4722 | |
| 4723 | inputData.push_back( |
| 4724 | { |
| 4725 | 19, 20, 21, |
| 4726 | 22, 23, 24, |
| 4727 | |
| 4728 | 25, 26, 27, |
| 4729 | 28, 29, 30, |
| 4730 | |
| 4731 | 31, 32, 33, |
| 4732 | 34, 35, 36 |
| 4733 | }); |
| 4734 | |
| 4735 | std::vector<T> outputExpectedData = |
| 4736 | { |
| 4737 | 1, 2, 3, |
| 4738 | 19, 20, 21, |
| 4739 | |
| 4740 | 4, 5, 6, |
| 4741 | 22, 23, 24, |
| 4742 | |
| 4743 | |
| 4744 | 7, 8, 9, |
| 4745 | 25, 26, 27, |
| 4746 | |
| 4747 | 10, 11, 12, |
| 4748 | 28, 29, 30, |
| 4749 | |
| 4750 | 13, 14, 15, |
| 4751 | 31, 32, 33, |
| 4752 | |
| 4753 | 16, 17, 18, |
| 4754 | 34, 35, 36 |
| 4755 | }; |
| 4756 | |
| 4757 | return StackTestHelper<ArmnnType, T, 4>( |
| 4758 | workloadFactory, |
| 4759 | memoryManager, |
| 4760 | inputTensorInfo, |
| 4761 | outputTensorInfo, |
| 4762 | 2U, |
| 4763 | inputData, |
| 4764 | outputExpectedData |
| 4765 | ); |
| 4766 | } |
| 4767 | |
| 4768 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4769 | LayerTestResult<T, 4> Stack4dOutput3AxisTest( |
| 4770 | armnn::IWorkloadFactory& workloadFactory, |
| 4771 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4772 | { |
| 4773 | armnn::TensorInfo inputTensorInfo ({ 3, 2, 3 }, ArmnnType); |
| 4774 | armnn::TensorInfo outputTensorInfo({ 3, 2, 3, 2 }, ArmnnType); |
| 4775 | |
| 4776 | std::vector<std::vector<T>> inputData; |
| 4777 | |
| 4778 | inputData.push_back( |
| 4779 | { |
| 4780 | 1, 2, 3, |
| 4781 | 4, 5, 6, |
| 4782 | |
| 4783 | 7, 8, 9, |
| 4784 | 10, 11, 12, |
| 4785 | |
| 4786 | 13, 14, 15, |
| 4787 | 16, 17, 18 |
| 4788 | }); |
| 4789 | |
| 4790 | inputData.push_back( |
| 4791 | { |
| 4792 | 19, 20, 21, |
| 4793 | 22, 23, 24, |
| 4794 | |
| 4795 | 25, 26, 27, |
| 4796 | 28, 29, 30, |
| 4797 | |
| 4798 | 31, 32, 33, |
| 4799 | 34, 35, 36 |
| 4800 | }); |
| 4801 | |
| 4802 | std::vector<T> outputExpectedData = |
| 4803 | { |
| 4804 | 1, 19, |
| 4805 | 2, 20, |
| 4806 | 3, 21, |
| 4807 | |
| 4808 | 4, 22, |
| 4809 | 5, 23, |
| 4810 | 6, 24, |
| 4811 | |
| 4812 | |
| 4813 | 7, 25, |
| 4814 | 8, 26, |
| 4815 | 9, 27, |
| 4816 | |
| 4817 | 10, 28, |
| 4818 | 11, 29, |
| 4819 | 12, 30, |
| 4820 | |
| 4821 | |
| 4822 | 13, 31, |
| 4823 | 14, 32, |
| 4824 | 15, 33, |
| 4825 | |
| 4826 | 16, 34, |
| 4827 | 17, 35, |
| 4828 | 18, 36 |
| 4829 | }; |
| 4830 | |
| 4831 | return StackTestHelper<ArmnnType, T, 4>( |
| 4832 | workloadFactory, |
| 4833 | memoryManager, |
| 4834 | inputTensorInfo, |
| 4835 | outputTensorInfo, |
| 4836 | 3U, |
| 4837 | inputData, |
| 4838 | outputExpectedData |
| 4839 | ); |
| 4840 | } |
| 4841 | |
| 4842 | template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
| 4843 | LayerTestResult<T, 3> Stack3dOutput1Axis3InputTest( |
| 4844 | armnn::IWorkloadFactory& workloadFactory, |
| 4845 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 4846 | { |
| 4847 | armnn::TensorInfo inputTensorInfo ({ 3, 3 }, ArmnnType); |
| 4848 | armnn::TensorInfo outputTensorInfo({ 3, 3, 3 }, ArmnnType); |
| 4849 | |
| 4850 | std::vector<std::vector<T>> inputData; |
| 4851 | |
| 4852 | inputData.push_back( |
| 4853 | { |
| 4854 | 1, 2, 3, |
| 4855 | 4, 5, 6, |
| 4856 | 7, 8, 9 |
| 4857 | }); |
| 4858 | |
| 4859 | inputData.push_back( |
| 4860 | { |
| 4861 | 10, 11, 12, |
| 4862 | 13, 14, 15, |
| 4863 | 16, 17, 18 |
| 4864 | }); |
| 4865 | |
| 4866 | inputData.push_back( |
| 4867 | { |
| 4868 | 19, 20, 21, |
| 4869 | 22, 23, 24, |
| 4870 | 25, 26, 27 |
| 4871 | }); |
| 4872 | |
| 4873 | std::vector<T> outputExpectedData = |
| 4874 | { |
| 4875 | 1, 2, 3, |
| 4876 | 10, 11, 12, |
| 4877 | 19, 20, 21, |
| 4878 | |
| 4879 | 4, 5, 6, |
| 4880 | 13, 14, 15, |
| 4881 | 22, 23, 24, |
| 4882 | |
| 4883 | 7, 8, 9, |
| 4884 | 16, 17, 18, |
| 4885 | 25, 26, 27 |
| 4886 | }; |
| 4887 | |
| 4888 | return StackTestHelper<ArmnnType, T, 3>( |
| 4889 | workloadFactory, |
| 4890 | memoryManager, |
| 4891 | inputTensorInfo, |
| 4892 | outputTensorInfo, |
| 4893 | 1U, |
| 4894 | inputData, |
| 4895 | outputExpectedData |
| 4896 | ); |
| 4897 | } |