Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 ARM Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #ifndef ARM_COMPUTE_TEST_CONVOLUTION_LAYER_FIXTURE |
| 25 | #define ARM_COMPUTE_TEST_CONVOLUTION_LAYER_FIXTURE |
| 26 | |
| 27 | #include "arm_compute/core/TensorShape.h" |
| 28 | #include "arm_compute/core/Types.h" |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 29 | #include "arm_compute/runtime/NEON/NEScheduler.h" |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 30 | #include "tests/AssetsLibrary.h" |
| 31 | #include "tests/Globals.h" |
| 32 | #include "tests/IAccessor.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Fixture.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 35 | #include "tests/validation/Helpers.h" |
Georgios Pinitas | 5a7e776 | 2017-12-01 16:27:29 +0000 | [diff] [blame] | 36 | #include "tests/validation/reference/ConvolutionLayer.h" |
| 37 | #include "tests/validation/reference/Utils.h" |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 38 | |
| 39 | #include <random> |
| 40 | |
| 41 | namespace arm_compute |
| 42 | { |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 43 | class NEConvolutionLayer; |
| 44 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 45 | namespace test |
| 46 | { |
| 47 | namespace validation |
| 48 | { |
| 49 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 50 | class ConvolutionValidationGenericFixture : public framework::Fixture |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 51 | { |
| 52 | public: |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 53 | using TBias = typename std::conditional<std::is_same<typename std::decay<T>::type, uint8_t>::value, int32_t, T>::type; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 54 | |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 55 | public: |
| 56 | template <typename...> |
| 57 | void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, bool reshape_weights, |
| 58 | DataType data_type, int fractional_bits, QuantizationInfo quantization_info) |
| 59 | { |
| 60 | _data_type = data_type; |
| 61 | _is_quantized = is_data_type_quantized_asymmetric(data_type); |
| 62 | _bias_data_type = _is_quantized ? DataType::S32 : data_type; |
| 63 | _fractional_bits = fractional_bits; |
| 64 | _quantization_info = quantization_info; |
| 65 | |
| 66 | _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights); |
| 67 | _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | protected: |
| 71 | template <typename U> |
| 72 | void fill(U &&tensor, int i) |
| 73 | { |
| 74 | switch(tensor.data_type()) |
| 75 | { |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 76 | case DataType::QASYMM8: |
| 77 | { |
| 78 | std::uniform_int_distribution<uint8_t> distribution(0, 3); |
| 79 | library->fill(tensor, distribution, i); |
| 80 | break; |
| 81 | } |
| 82 | case DataType::S32: |
| 83 | { |
| 84 | std::uniform_int_distribution<int32_t> distribution(-100, 100); |
| 85 | library->fill(tensor, distribution, i); |
| 86 | break; |
| 87 | } |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 88 | case DataType::F16: |
| 89 | case DataType::F32: |
| 90 | { |
| 91 | std::uniform_real_distribution<> distribution(-1.0f, 1.0f); |
| 92 | library->fill(tensor, distribution, i); |
| 93 | break; |
| 94 | } |
| 95 | default: |
| 96 | library->fill_tensor_uniform(tensor, i); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, const PadStrideInfo &info, |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 101 | bool reshape_weights) |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 102 | { |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 103 | WeightsInfo weights_info(!reshape_weights, weights_shape.x(), weights_shape.y(), weights_shape[3]); |
| 104 | TensorShape reshaped_weights_shape(weights_shape); |
| 105 | |
| 106 | if(!reshape_weights) |
| 107 | { |
| 108 | // Check if its a "fully connected" convolution |
| 109 | const bool is_fully_connected_convolution = (output_shape.x() == 1 && output_shape.y() == 1); |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 110 | bool is_optimised = false; |
| 111 | #if defined(__arm__) |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 112 | is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU == CPUTarget::ARMV7 && _data_type == DataType::F32; |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 113 | #elif defined(__aarch64__) |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 114 | is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV8 && _data_type == DataType::F32; |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 115 | #endif /* defined(__arm__) || defined(__aarch64__) */ |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 116 | |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 117 | reshaped_weights_shape.collapse(3); |
| 118 | |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 119 | if(bias_shape.total_size() > 0 && !_is_quantized) |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 120 | { |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 121 | // Add bias to the weights reshaped matrix |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 122 | reshaped_weights_shape.set(0, reshaped_weights_shape.x() + 1); |
| 123 | } |
| 124 | |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 125 | if(is_fully_connected_convolution || is_optimised) |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 126 | { |
| 127 | const size_t shape_x = reshaped_weights_shape.x(); |
| 128 | reshaped_weights_shape.set(0, reshaped_weights_shape.y()); |
| 129 | reshaped_weights_shape.set(1, shape_x); |
| 130 | } |
| 131 | else |
| 132 | { |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 133 | const int interleave_width = 16 / data_size_from_type(_data_type); |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 134 | reshaped_weights_shape.set(0, reshaped_weights_shape.x() * interleave_width); |
| 135 | reshaped_weights_shape.set(1, static_cast<unsigned int>(std::ceil(reshaped_weights_shape.y() / static_cast<float>(interleave_width)))); |
| 136 | } |
| 137 | } |
| 138 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 139 | // Create tensors |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 140 | TensorType src = create_tensor<TensorType>(input_shape, _data_type, 1, _fractional_bits, _quantization_info); |
| 141 | TensorType weights = create_tensor<TensorType>(reshaped_weights_shape, _data_type, 1, _fractional_bits, _quantization_info); |
| 142 | TensorType bias = create_tensor<TensorType>(bias_shape, _bias_data_type, 1, _fractional_bits, _quantization_info); |
| 143 | TensorType dst = create_tensor<TensorType>(output_shape, _data_type, 1, _fractional_bits, _quantization_info); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 144 | |
| 145 | // Create and configure function |
| 146 | FunctionType conv; |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 147 | conv.configure(&src, &weights, &bias, &dst, info, weights_info); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 148 | |
| 149 | ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 150 | ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 151 | ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 152 | ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 153 | |
| 154 | // Allocate tensors |
| 155 | src.allocator()->allocate(); |
| 156 | weights.allocator()->allocate(); |
| 157 | bias.allocator()->allocate(); |
| 158 | dst.allocator()->allocate(); |
| 159 | |
| 160 | ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 161 | ARM_COMPUTE_EXPECT(!weights.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 162 | ARM_COMPUTE_EXPECT(!bias.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 163 | ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 164 | |
| 165 | // Fill tensors |
| 166 | fill(AccessorType(src), 0); |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 167 | |
| 168 | if(!reshape_weights) |
| 169 | { |
| 170 | const bool is_fully_connected_convolution = (output_shape.x() == 1 && output_shape.y() == 1); |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 171 | bool is_optimised = false; |
| 172 | #if defined(__arm__) |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 173 | is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU == CPUTarget::ARMV7 && _data_type == DataType::F32; |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 174 | #elif defined(__aarch64__) |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 175 | is_optimised = std::is_same<FunctionType, NEConvolutionLayer>::value && NEScheduler::get().cpu_info().CPU >= CPUTarget::ARMV8 && _data_type == DataType::F32; |
Gian Marco Iodice | ece307b | 2017-10-03 13:17:02 +0100 | [diff] [blame] | 176 | #endif /* defined(__arm__) || defined(__aarch64__) */ |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 177 | |
| 178 | TensorShape tmp_weights_shape(weights_shape); |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 179 | SimpleTensor<T> tmp_weights(tmp_weights_shape, _data_type, 1, _fractional_bits, _quantization_info); |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 180 | |
| 181 | // Fill with original shape |
| 182 | fill(tmp_weights, 1); |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 183 | |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 184 | if(_is_quantized) |
| 185 | { |
| 186 | fill(AccessorType(bias), 2); |
| 187 | tmp_weights = linearise_weights(tmp_weights); |
| 188 | } |
| 189 | else |
| 190 | { |
| 191 | SimpleTensor<T> tmp_bias(bias_shape, _bias_data_type, 1, _fractional_bits, _quantization_info); |
| 192 | fill(tmp_bias, 2); |
| 193 | tmp_weights = linearise_weights(tmp_weights, &tmp_bias); |
| 194 | } |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 195 | |
Moritz Pflanzer | beabe3b | 2017-08-31 14:56:32 +0100 | [diff] [blame] | 196 | if(!is_fully_connected_convolution && !is_optimised) |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 197 | { |
| 198 | // Transpose with interleave |
| 199 | const int interleave_size = 16 / tmp_weights.element_size(); |
| 200 | tmp_weights = transpose(std::move(tmp_weights), interleave_size); |
| 201 | } |
| 202 | |
| 203 | AccessorType weights_accessor(weights); |
| 204 | |
| 205 | for(int i = 0; i < tmp_weights.num_elements(); ++i) |
| 206 | { |
| 207 | Coordinates coord = index2coord(tmp_weights.shape(), i); |
| 208 | std::copy_n(static_cast<const T *>(tmp_weights(coord)), 1, static_cast<T *>(weights_accessor(coord))); |
| 209 | } |
| 210 | } |
| 211 | else |
| 212 | { |
| 213 | fill(AccessorType(weights), 1); |
| 214 | fill(AccessorType(bias), 2); |
| 215 | } |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 216 | |
| 217 | // Compute NEConvolutionLayer function |
| 218 | conv.run(); |
| 219 | |
| 220 | return dst; |
| 221 | } |
| 222 | |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 223 | SimpleTensor<T> compute_reference(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, const PadStrideInfo &info) |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 224 | { |
| 225 | // Create reference |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 226 | SimpleTensor<T> src{ input_shape, _data_type, 1, _fractional_bits, _quantization_info }; |
| 227 | SimpleTensor<T> weights{ weights_shape, _data_type, 1, _fractional_bits, _quantization_info }; |
| 228 | SimpleTensor<TBias> bias{ bias_shape, _bias_data_type, 1, _fractional_bits, _quantization_info }; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 229 | |
| 230 | // Fill reference |
| 231 | fill(src, 0); |
| 232 | fill(weights, 1); |
| 233 | fill(bias, 2); |
| 234 | |
| 235 | return reference::convolution_layer<T>(src, weights, bias, output_shape, info); |
| 236 | } |
| 237 | |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 238 | TensorType _target{}; |
| 239 | SimpleTensor<T> _reference{}; |
| 240 | DataType _data_type{}; |
| 241 | DataType _bias_data_type{}; |
| 242 | int _fractional_bits{}; |
| 243 | QuantizationInfo _quantization_info{}; |
| 244 | bool _is_quantized = false; |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 245 | |
| 246 | private: |
| 247 | template <typename U> |
| 248 | SimpleTensor<U> linearise_weights(const SimpleTensor<U> &weights, const SimpleTensor<U> *biases = nullptr) |
| 249 | { |
| 250 | TensorShape dst_shape(weights.shape()); |
| 251 | dst_shape.collapse(3); |
| 252 | |
| 253 | if(biases != nullptr) |
| 254 | { |
| 255 | dst_shape.set(0, dst_shape.x() + 1); |
| 256 | } |
| 257 | |
| 258 | const size_t shape_x = dst_shape.x(); |
| 259 | dst_shape.set(0, dst_shape.y()); |
| 260 | dst_shape.set(1, shape_x); |
| 261 | |
| 262 | SimpleTensor<U> dst(dst_shape, weights.data_type()); |
| 263 | |
| 264 | // Don't iterate over biases yet |
| 265 | for(int weights_idx = 0; weights_idx < weights.num_elements(); ++weights_idx) |
| 266 | { |
| 267 | Coordinates weights_coord = index2coord(weights.shape(), weights_idx); |
| 268 | const int dst_row = weights_idx % weights.shape().total_size_lower(3); |
| 269 | Coordinates dst_coord{ weights_coord[3], dst_row, weights_coord[4] }; |
| 270 | const int dst_idx = coord2index(dst.shape(), dst_coord); |
| 271 | |
| 272 | dst[dst_idx] = weights[weights_idx]; |
| 273 | } |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 274 | if(biases != nullptr) |
| 275 | { |
| 276 | // Fill last row with biases |
| 277 | for(int bias_idx = 0; bias_idx < biases->num_elements(); ++bias_idx) |
| 278 | { |
| 279 | Coordinates bias_coord = index2coord(biases->shape(), bias_idx); |
| 280 | Coordinates dst_coord{ bias_coord.x(), static_cast<int>(dst.shape().y()) - 1, bias_coord.y() }; |
| 281 | int dst_idx = coord2index(dst.shape(), dst_coord); |
| 282 | |
| 283 | dst[dst_idx] = (*biases)[bias_idx]; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | return dst; |
| 288 | } |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 289 | }; |
| 290 | |
| 291 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 292 | class ConvolutionValidationFixture : public ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T> |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 293 | { |
| 294 | public: |
| 295 | template <typename...> |
Moritz Pflanzer | cde1e8a | 2017-09-08 09:53:14 +0100 | [diff] [blame] | 296 | void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, bool reshape_weights, DataType data_type) |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 297 | { |
Chunosov | 5124be5 | 2017-11-22 20:42:13 +0700 | [diff] [blame] | 298 | ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights, data_type, 0, QuantizationInfo()); |
| 299 | } |
| 300 | }; |
| 301 | |
| 302 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 303 | class ConvolutionValidationFixedPointFixture : public ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T> |
| 304 | { |
| 305 | public: |
| 306 | template <typename...> |
| 307 | void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, bool reshape_weights, DataType data_type, int fractional_bits) |
| 308 | { |
| 309 | ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights, data_type, fractional_bits, |
| 310 | QuantizationInfo()); |
| 311 | } |
| 312 | }; |
| 313 | |
| 314 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 315 | class ConvolutionValidationQuantizedFixture : public ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T> |
| 316 | { |
| 317 | public: |
| 318 | template <typename...> |
| 319 | void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, bool reshape_weights, DataType data_type, |
| 320 | QuantizationInfo quantization_info) |
| 321 | { |
| 322 | ConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights, data_type, 0, quantization_info); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 323 | } |
| 324 | }; |
| 325 | } // namespace validation |
| 326 | } // namespace test |
| 327 | } // namespace arm_compute |
| 328 | #endif /* ARM_COMPUTE_TEST_CONVOLUTION_LAYER_FIXTURE */ |