Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 1 | /* |
Georgios Pinitas | c6f9510 | 2021-03-30 10:03:01 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2021 Arm Limited. |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 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 | */ |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 24 | #include "tests/validation/Helpers.h" |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 25 | |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 26 | #include <algorithm> |
| 27 | #include <cmath> |
| 28 | |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 29 | namespace arm_compute |
| 30 | { |
| 31 | namespace test |
| 32 | { |
| 33 | namespace validation |
| 34 | { |
Michalis Spyrou | ed7b27d | 2019-11-27 16:04:17 +0000 | [diff] [blame] | 35 | template <> |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 36 | SimpleTensor<float> convert_from_asymmetric(const SimpleTensor<uint8_t> &src) |
| 37 | { |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 38 | const UniformQuantizationInfo &quantization_info = src.quantization_info().uniform(); |
| 39 | SimpleTensor<float> dst{ src.shape(), DataType::F32, 1, QuantizationInfo(), src.data_layout() }; |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 40 | #if defined(_OPENMP) |
| 41 | #pragma omp parallel for |
| 42 | #endif /* _OPENMP */ |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 43 | for(int i = 0; i < src.num_elements(); ++i) |
| 44 | { |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 45 | dst[i] = dequantize_qasymm8(src[i], quantization_info); |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 46 | } |
| 47 | return dst; |
| 48 | } |
| 49 | |
Michalis Spyrou | ed7b27d | 2019-11-27 16:04:17 +0000 | [diff] [blame] | 50 | template <> |
Georgios Pinitas | 6e1791b | 2019-12-02 19:01:25 +0000 | [diff] [blame] | 51 | SimpleTensor<float> convert_from_asymmetric(const SimpleTensor<int8_t> &src) |
| 52 | { |
| 53 | const UniformQuantizationInfo &quantization_info = src.quantization_info().uniform(); |
| 54 | SimpleTensor<float> dst{ src.shape(), DataType::F32, 1, QuantizationInfo(), src.data_layout() }; |
| 55 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 56 | #if defined(_OPENMP) |
| 57 | #pragma omp parallel for |
| 58 | #endif /* _OPENMP */ |
Georgios Pinitas | 6e1791b | 2019-12-02 19:01:25 +0000 | [diff] [blame] | 59 | for(int i = 0; i < src.num_elements(); ++i) |
| 60 | { |
| 61 | dst[i] = dequantize_qasymm8_signed(src[i], quantization_info); |
| 62 | } |
| 63 | return dst; |
| 64 | } |
| 65 | |
| 66 | template <> |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 67 | SimpleTensor<float> convert_from_asymmetric(const SimpleTensor<uint16_t> &src) |
| 68 | { |
| 69 | const UniformQuantizationInfo &quantization_info = src.quantization_info().uniform(); |
| 70 | SimpleTensor<float> dst{ src.shape(), DataType::F32, 1, QuantizationInfo(), src.data_layout() }; |
| 71 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 72 | #if defined(_OPENMP) |
| 73 | #pragma omp parallel for |
| 74 | #endif /* _OPENMP */ |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 75 | for(int i = 0; i < src.num_elements(); ++i) |
| 76 | { |
| 77 | dst[i] = dequantize_qasymm16(src[i], quantization_info); |
| 78 | } |
| 79 | return dst; |
| 80 | } |
| 81 | |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 82 | template <> |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 83 | SimpleTensor<uint8_t> convert_to_asymmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info) |
| 84 | { |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 85 | SimpleTensor<uint8_t> dst{ src.shape(), DataType::QASYMM8, 1, quantization_info }; |
| 86 | const UniformQuantizationInfo &qinfo = quantization_info.uniform(); |
| 87 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 88 | #if defined(_OPENMP) |
| 89 | #pragma omp parallel for |
| 90 | #endif /* _OPENMP */ |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 91 | for(int i = 0; i < src.num_elements(); ++i) |
| 92 | { |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 93 | dst[i] = quantize_qasymm8(src[i], qinfo); |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 94 | } |
| 95 | return dst; |
| 96 | } |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 97 | |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 98 | template <> |
Sang-Hoon Park | ae6ef7c | 2019-11-13 16:51:45 +0000 | [diff] [blame] | 99 | SimpleTensor<int8_t> convert_to_asymmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info) |
| 100 | { |
| 101 | SimpleTensor<int8_t> dst{ src.shape(), DataType::QASYMM8_SIGNED, 1, quantization_info }; |
| 102 | const UniformQuantizationInfo &qinfo = quantization_info.uniform(); |
| 103 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 104 | #if defined(_OPENMP) |
| 105 | #pragma omp parallel for |
| 106 | #endif /* _OPENMP */ |
Sang-Hoon Park | ae6ef7c | 2019-11-13 16:51:45 +0000 | [diff] [blame] | 107 | for(int i = 0; i < src.num_elements(); ++i) |
| 108 | { |
| 109 | dst[i] = quantize_qasymm8_signed(src[i], qinfo); |
| 110 | } |
| 111 | return dst; |
| 112 | } |
| 113 | |
Michalis Spyrou | ed7b27d | 2019-11-27 16:04:17 +0000 | [diff] [blame] | 114 | template <> |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 115 | SimpleTensor<uint16_t> convert_to_asymmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info) |
| 116 | { |
| 117 | SimpleTensor<uint16_t> dst{ src.shape(), DataType::QASYMM16, 1, quantization_info }; |
| 118 | const UniformQuantizationInfo &qinfo = quantization_info.uniform(); |
| 119 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 120 | #if defined(_OPENMP) |
| 121 | #pragma omp parallel for |
| 122 | #endif /* _OPENMP */ |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 123 | for(int i = 0; i < src.num_elements(); ++i) |
| 124 | { |
| 125 | dst[i] = quantize_qasymm16(src[i], qinfo); |
| 126 | } |
| 127 | return dst; |
| 128 | } |
| 129 | |
| 130 | template <> |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 131 | SimpleTensor<int16_t> convert_to_symmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info) |
| 132 | { |
| 133 | SimpleTensor<int16_t> dst{ src.shape(), DataType::QSYMM16, 1, quantization_info }; |
| 134 | const UniformQuantizationInfo &qinfo = quantization_info.uniform(); |
| 135 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 136 | #if defined(_OPENMP) |
| 137 | #pragma omp parallel for |
| 138 | #endif /* _OPENMP */ |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 139 | for(int i = 0; i < src.num_elements(); ++i) |
| 140 | { |
| 141 | dst[i] = quantize_qsymm16(src[i], qinfo); |
| 142 | } |
| 143 | return dst; |
| 144 | } |
| 145 | |
| 146 | template <> |
| 147 | SimpleTensor<float> convert_from_symmetric(const SimpleTensor<int16_t> &src) |
| 148 | { |
| 149 | const UniformQuantizationInfo &quantization_info = src.quantization_info().uniform(); |
| 150 | SimpleTensor<float> dst{ src.shape(), DataType::F32, 1, QuantizationInfo(), src.data_layout() }; |
| 151 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 152 | #if defined(_OPENMP) |
| 153 | #pragma omp parallel for |
| 154 | #endif /* _OPENMP */ |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 155 | for(int i = 0; i < src.num_elements(); ++i) |
| 156 | { |
| 157 | dst[i] = dequantize_qsymm16(src[i], quantization_info); |
| 158 | } |
| 159 | return dst; |
| 160 | } |
| 161 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 162 | template <typename T> |
| 163 | void matrix_multiply(const SimpleTensor<T> &a, const SimpleTensor<T> &b, SimpleTensor<T> &out) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 164 | { |
| 165 | ARM_COMPUTE_ERROR_ON(a.shape()[0] != b.shape()[1]); |
| 166 | ARM_COMPUTE_ERROR_ON(a.shape()[1] != out.shape()[1]); |
| 167 | ARM_COMPUTE_ERROR_ON(b.shape()[0] != out.shape()[0]); |
| 168 | |
| 169 | const int M = a.shape()[1]; // Rows |
| 170 | const int N = b.shape()[0]; // Cols |
| 171 | const int K = b.shape()[1]; |
| 172 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 173 | #if defined(_OPENMP) |
| 174 | #pragma omp parallel for collapse(2) |
| 175 | #endif /* _OPENMP */ |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 176 | for(int y = 0; y < M; ++y) |
| 177 | { |
| 178 | for(int x = 0; x < N; ++x) |
| 179 | { |
| 180 | float acc = 0.0f; |
| 181 | for(int k = 0; k < K; ++k) |
| 182 | { |
| 183 | acc += a[y * K + k] * b[x + k * N]; |
| 184 | } |
| 185 | |
| 186 | out[x + y * N] = acc; |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 191 | template <typename T> |
| 192 | void transpose_matrix(const SimpleTensor<T> &in, SimpleTensor<T> &out) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 193 | { |
| 194 | ARM_COMPUTE_ERROR_ON((in.shape()[0] != out.shape()[1]) || (in.shape()[1] != out.shape()[0])); |
| 195 | |
| 196 | const int width = in.shape()[0]; |
| 197 | const int height = in.shape()[1]; |
| 198 | |
Michalis Spyrou | d1d7722 | 2020-04-08 14:10:15 +0100 | [diff] [blame] | 199 | #if defined(_OPENMP) |
| 200 | #pragma omp parallel for collapse(2) |
| 201 | #endif /* _OPENMP */ |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 202 | for(int y = 0; y < height; ++y) |
| 203 | { |
| 204 | for(int x = 0; x < width; ++x) |
| 205 | { |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 206 | const T val = in[x + y * width]; |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 207 | |
| 208 | out[x * height + y] = val; |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | template <typename T> |
| 214 | void get_tile(const SimpleTensor<T> &in, SimpleTensor<T> &tile, const Coordinates &coord) |
| 215 | { |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 216 | ARM_COMPUTE_ERROR_ON(tile.shape().num_dimensions() > 2); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 217 | |
| 218 | const int w_tile = tile.shape()[0]; |
| 219 | const int h_tile = tile.shape()[1]; |
| 220 | |
| 221 | // Fill the tile with zeros |
| 222 | std::fill(tile.data() + 0, (tile.data() + (w_tile * h_tile)), static_cast<T>(0)); |
| 223 | |
| 224 | // Check if with the dimensions greater than 2 we could have out-of-bound reads |
| 225 | for(size_t d = 2; d < Coordinates::num_max_dimensions; ++d) |
| 226 | { |
| 227 | if(coord[d] < 0 || coord[d] >= static_cast<int>(in.shape()[d])) |
| 228 | { |
| 229 | ARM_COMPUTE_ERROR("coord[d] < 0 || coord[d] >= in.shape()[d] with d >= 2"); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | // Since we could have out-of-bound reads along the X and Y dimensions, |
| 234 | // we start calculating the input address with x = 0 and y = 0 |
| 235 | Coordinates start_coord = coord; |
| 236 | start_coord[0] = 0; |
| 237 | start_coord[1] = 0; |
| 238 | |
| 239 | // Get input and roi pointers |
| 240 | auto in_ptr = static_cast<const T *>(in(start_coord)); |
| 241 | auto roi_ptr = static_cast<T *>(tile.data()); |
| 242 | |
| 243 | const int x_in_start = std::max(0, coord[0]); |
| 244 | const int y_in_start = std::max(0, coord[1]); |
| 245 | const int x_in_end = std::min(static_cast<int>(in.shape()[0]), coord[0] + w_tile); |
| 246 | const int y_in_end = std::min(static_cast<int>(in.shape()[1]), coord[1] + h_tile); |
| 247 | |
| 248 | // Number of elements to copy per row |
| 249 | const int n = x_in_end - x_in_start; |
| 250 | |
| 251 | // Starting coordinates for the ROI |
| 252 | const int x_tile_start = coord[0] > 0 ? 0 : std::abs(coord[0]); |
| 253 | const int y_tile_start = coord[1] > 0 ? 0 : std::abs(coord[1]); |
| 254 | |
| 255 | // Update input pointer |
| 256 | in_ptr += x_in_start; |
| 257 | in_ptr += (y_in_start * in.shape()[0]); |
| 258 | |
| 259 | // Update ROI pointer |
| 260 | roi_ptr += x_tile_start; |
| 261 | roi_ptr += (y_tile_start * tile.shape()[0]); |
| 262 | |
| 263 | for(int y = y_in_start; y < y_in_end; ++y) |
| 264 | { |
| 265 | // Copy per row |
| 266 | std::copy(in_ptr, in_ptr + n, roi_ptr); |
| 267 | |
| 268 | in_ptr += in.shape()[0]; |
| 269 | roi_ptr += tile.shape()[0]; |
| 270 | } |
| 271 | } |
| 272 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 273 | template <typename T> |
| 274 | void zeros(SimpleTensor<T> &in, const Coordinates &anchor, const TensorShape &shape) |
| 275 | { |
| 276 | ARM_COMPUTE_ERROR_ON(anchor.num_dimensions() != shape.num_dimensions()); |
| 277 | ARM_COMPUTE_ERROR_ON(in.shape().num_dimensions() > 2); |
| 278 | ARM_COMPUTE_ERROR_ON(shape.num_dimensions() > 2); |
| 279 | |
| 280 | // Check if with the dimensions greater than 2 we could have out-of-bound reads |
| 281 | for(size_t d = 0; d < Coordinates::num_max_dimensions; ++d) |
| 282 | { |
| 283 | if(anchor[d] < 0 || ((anchor[d] + shape[d]) > in.shape()[d])) |
| 284 | { |
| 285 | ARM_COMPUTE_ERROR("anchor[d] < 0 || (anchor[d] + shape[d]) > in.shape()[d]"); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // Get input pointer |
| 290 | auto in_ptr = static_cast<T *>(in(anchor[0] + anchor[1] * in.shape()[0])); |
| 291 | |
| 292 | const unsigned int n = in.shape()[0]; |
| 293 | |
| 294 | for(unsigned int y = 0; y < shape[1]; ++y) |
| 295 | { |
| 296 | std::fill(in_ptr, in_ptr + shape[0], 0); |
| 297 | in_ptr += n; |
| 298 | } |
| 299 | } |
| 300 | |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 301 | std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max) |
| 302 | { |
| 303 | ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max"); |
| 304 | |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 305 | const int min_bound = quantize_qasymm8(min, quant_info.uniform()); |
| 306 | const int max_bound = quantize_qasymm8(max, quant_info.uniform()); |
Michalis Spyrou | bcfd09a | 2019-05-01 13:03:59 +0100 | [diff] [blame] | 307 | return std::pair<int, int> { min_bound, max_bound }; |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 308 | } |
| 309 | |
Georgios Pinitas | 6e1791b | 2019-12-02 19:01:25 +0000 | [diff] [blame] | 310 | std::pair<int, int> get_quantized_qasymm8_signed_bounds(const QuantizationInfo &quant_info, float min, float max) |
| 311 | { |
| 312 | ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max"); |
| 313 | |
| 314 | const int min_bound = quantize_qasymm8_signed(min, quant_info.uniform()); |
| 315 | const int max_bound = quantize_qasymm8_signed(max, quant_info.uniform()); |
| 316 | return std::pair<int, int> { min_bound, max_bound }; |
| 317 | } |
| 318 | |
Georgios Pinitas | dbdea0d | 2019-10-16 19:21:40 +0100 | [diff] [blame] | 319 | std::pair<int, int> get_symm_quantized_per_channel_bounds(const QuantizationInfo &quant_info, float min, float max, size_t channel_id) |
| 320 | { |
| 321 | ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max"); |
| 322 | |
| 323 | const int min_bound = quantize_qsymm8_per_channel(min, quant_info, channel_id); |
| 324 | const int max_bound = quantize_qsymm8_per_channel(max, quant_info, channel_id); |
| 325 | return std::pair<int, int> { min_bound, max_bound }; |
| 326 | } |
| 327 | |
Giorgio Arena | 63825e8 | 2021-03-25 14:54:50 +0000 | [diff] [blame] | 328 | void add_padding_x(std::initializer_list<ITensor *> tensors, const DataLayout &data_layout) |
| 329 | { |
| 330 | if(data_layout == DataLayout::NHWC) |
| 331 | { |
| 332 | constexpr unsigned int lower = 1U; |
| 333 | constexpr unsigned int upper = 16U; |
| 334 | |
| 335 | std::uniform_int_distribution<unsigned int> distribution(lower, upper); |
| 336 | size_t seed_offset = 0; |
| 337 | |
| 338 | for(ITensor *tensor : tensors) |
| 339 | { |
| 340 | ARM_COMPUTE_ERROR_ON(!tensor->info()->is_resizable()); |
| 341 | |
| 342 | std::mt19937 gen(library->seed() + seed_offset++); |
| 343 | |
| 344 | const unsigned int right = distribution(gen); |
| 345 | const unsigned int left = distribution(gen); |
| 346 | |
| 347 | tensor->info()->extend_padding(PaddingSize(0U, right, 0U, left)); |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 352 | template void get_tile(const SimpleTensor<float> &in, SimpleTensor<float> &roi, const Coordinates &coord); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 353 | template void get_tile(const SimpleTensor<half> &in, SimpleTensor<half> &roi, const Coordinates &coord); |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 354 | template void get_tile(const SimpleTensor<int> &in, SimpleTensor<int> &roi, const Coordinates &coord); |
| 355 | template void get_tile(const SimpleTensor<short> &in, SimpleTensor<short> &roi, const Coordinates &coord); |
| 356 | template void get_tile(const SimpleTensor<char> &in, SimpleTensor<char> &roi, const Coordinates &coord); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 357 | template void zeros(SimpleTensor<float> &in, const Coordinates &anchor, const TensorShape &shape); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 358 | template void zeros(SimpleTensor<half> &in, const Coordinates &anchor, const TensorShape &shape); |
| 359 | template void transpose_matrix(const SimpleTensor<float> &in, SimpleTensor<float> &out); |
| 360 | template void transpose_matrix(const SimpleTensor<half> &in, SimpleTensor<half> &out); |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 361 | template void transpose_matrix(const SimpleTensor<int> &in, SimpleTensor<int> &out); |
| 362 | template void transpose_matrix(const SimpleTensor<short> &in, SimpleTensor<short> &out); |
| 363 | template void transpose_matrix(const SimpleTensor<char> &in, SimpleTensor<char> &out); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 364 | template void matrix_multiply(const SimpleTensor<float> &a, const SimpleTensor<float> &b, SimpleTensor<float> &out); |
| 365 | template void matrix_multiply(const SimpleTensor<half> &a, const SimpleTensor<half> &b, SimpleTensor<half> &out); |
| 366 | |
Moritz Pflanzer | 3ce3ff4 | 2017-07-21 17:41:02 +0100 | [diff] [blame] | 367 | } // namespace validation |
| 368 | } // namespace test |
| 369 | } // namespace arm_compute |