Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Gunes Bayir | 9d0c4de | 2023-04-13 18:22:58 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2023 Arm Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +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 | */ |
Anitha Raj | b566b6e | 2023-08-23 11:40:06 +0100 | [diff] [blame] | 24 | #ifndef ACL_TESTS_VALIDATION_HELPERS_H |
| 25 | #define ACL_TESTS_VALIDATION_HELPERS_H |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 26 | |
Georgios Pinitas | 7b7858d | 2017-06-21 16:44:24 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/Types.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/Utils.h" |
SiCong Li | 9129549 | 2023-07-21 18:16:13 +0100 | [diff] [blame] | 29 | #include "arm_compute/function_info/ActivationLayerInfo.h" |
Moritz Pflanzer | 6c6597c | 2017-09-24 12:09:41 +0100 | [diff] [blame] | 30 | #include "support/Half.h" |
John Richardson | 6f4d49f | 2017-09-07 11:21:10 +0100 | [diff] [blame] | 31 | #include "tests/Globals.h" |
Moritz Pflanzer | 6c6597c | 2017-09-24 12:09:41 +0100 | [diff] [blame] | 32 | #include "tests/SimpleTensor.h" |
Georgios Pinitas | 7b7858d | 2017-06-21 16:44:24 +0100 | [diff] [blame] | 33 | |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 34 | #include <cmath> |
| 35 | #include <cstdint> |
Georgios Pinitas | 7b7858d | 2017-06-21 16:44:24 +0100 | [diff] [blame] | 36 | #include <random> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 37 | #include <type_traits> |
| 38 | #include <utility> |
| 39 | |
| 40 | namespace arm_compute |
| 41 | { |
| 42 | namespace test |
| 43 | { |
| 44 | namespace validation |
| 45 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 46 | template <typename T> |
| 47 | struct is_floating_point : public std::is_floating_point<T> |
Pablo Tello | 8fda1cb | 2017-07-05 15:20:38 +0100 | [diff] [blame] | 48 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | template <> |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 52 | struct is_floating_point<half> : public std::true_type |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 53 | { |
| 54 | }; |
Pablo Tello | 8fda1cb | 2017-07-05 15:20:38 +0100 | [diff] [blame] | 55 | |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 56 | /** Helper struct to store the hints for |
| 57 | * - destination quantization info |
| 58 | * - minimum bias value |
| 59 | * - maximum bias value |
| 60 | * in quantized test construction. |
| 61 | */ |
| 62 | struct QuantizationHint |
| 63 | { |
| 64 | QuantizationInfo q_info; |
| 65 | int32_t bias_min; |
| 66 | int32_t bias_max; |
| 67 | }; |
| 68 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 69 | /** Helper function to get the testing range for each activation layer. |
| 70 | * |
Vidhya Sudhan Loganathan | 014333d | 2018-07-02 09:13:49 +0100 | [diff] [blame] | 71 | * @param[in] activation Activation function to test. |
| 72 | * @param[in] data_type Data type. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 73 | * |
| 74 | * @return A pair containing the lower upper testing bounds for a given function. |
| 75 | */ |
| 76 | template <typename T> |
Vidhya Sudhan Loganathan | 014333d | 2018-07-02 09:13:49 +0100 | [diff] [blame] | 77 | std::pair<T, T> get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction activation, DataType data_type) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 78 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 79 | std::pair<T, T> bounds; |
| 80 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 81 | switch(data_type) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 82 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 83 | case DataType::F16: |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 84 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 85 | using namespace half_float::literal; |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 86 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 87 | switch(activation) |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 88 | { |
Georgios Pinitas | 3463a8b | 2018-08-23 13:11:53 +0100 | [diff] [blame] | 89 | case ActivationLayerInfo::ActivationFunction::TANH: |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 90 | case ActivationLayerInfo::ActivationFunction::SQUARE: |
| 91 | case ActivationLayerInfo::ActivationFunction::LOGISTIC: |
| 92 | case ActivationLayerInfo::ActivationFunction::SOFT_RELU: |
| 93 | // Reduce range as exponent overflows |
Georgios Pinitas | 3463a8b | 2018-08-23 13:11:53 +0100 | [diff] [blame] | 94 | bounds = std::make_pair(-2._h, 2._h); |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 95 | break; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 96 | case ActivationLayerInfo::ActivationFunction::SQRT: |
| 97 | // Reduce range as sqrt should take a non-negative number |
Georgios Pinitas | 3463a8b | 2018-08-23 13:11:53 +0100 | [diff] [blame] | 98 | bounds = std::make_pair(0._h, 128._h); |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 99 | break; |
| 100 | default: |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 101 | bounds = std::make_pair(-255._h, 255._h); |
| 102 | break; |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 103 | } |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 104 | break; |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 105 | } |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 106 | case DataType::F32: |
| 107 | switch(activation) |
| 108 | { |
Gunes Bayir | 01934e9 | 2022-11-02 11:50:37 +0000 | [diff] [blame] | 109 | case ActivationLayerInfo::ActivationFunction::SOFT_RELU: |
| 110 | // Reduce range as exponent overflows |
| 111 | bounds = std::make_pair(-40.f, 40.f); |
| 112 | break; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 113 | case ActivationLayerInfo::ActivationFunction::SQRT: |
| 114 | // Reduce range as sqrt should take a non-negative number |
| 115 | bounds = std::make_pair(0.f, 255.f); |
| 116 | break; |
| 117 | default: |
| 118 | bounds = std::make_pair(-255.f, 255.f); |
| 119 | break; |
| 120 | } |
| 121 | break; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 122 | default: |
| 123 | ARM_COMPUTE_ERROR("Unsupported data type"); |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 124 | } |
| 125 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 126 | return bounds; |
Isabella Gottardi | 3b77e9d | 2017-06-22 11:05:41 +0100 | [diff] [blame] | 127 | } |
| 128 | |
Sang-Hoon Park | 0779fec | 2019-11-13 17:08:12 +0000 | [diff] [blame] | 129 | /** Convert an asymmetric quantized simple tensor into float using tensor quantization information. |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 130 | * |
| 131 | * @param[in] src Quantized tensor. |
| 132 | * |
| 133 | * @return Float tensor. |
Anthony Barbier | f202e50 | 2017-11-23 18:02:04 +0000 | [diff] [blame] | 134 | */ |
Michalis Spyrou | ed7b27d | 2019-11-27 16:04:17 +0000 | [diff] [blame] | 135 | template <typename T> |
| 136 | SimpleTensor<float> convert_from_asymmetric(const SimpleTensor<T> &src); |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 137 | |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 138 | /** Convert float simple tensor into quantized using specified quantization information. |
| 139 | * |
| 140 | * @param[in] src Float tensor. |
| 141 | * @param[in] quantization_info Quantification information. |
| 142 | * |
ramy.elgammal@arm.com | a2561f0 | 2023-06-16 20:45:48 +0100 | [diff] [blame] | 143 | * \relates arm_compute::test::SimpleTensor |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 144 | * @return Quantized tensor. |
Anthony Barbier | f202e50 | 2017-11-23 18:02:04 +0000 | [diff] [blame] | 145 | */ |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 146 | template <typename T> |
| 147 | SimpleTensor<T> convert_to_asymmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info); |
| 148 | |
| 149 | /** Convert quantized simple tensor into float using tensor quantization information. |
| 150 | * |
| 151 | * @param[in] src Quantized tensor. |
| 152 | * |
| 153 | * @return Float tensor. |
| 154 | */ |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 155 | template <typename T> |
| 156 | SimpleTensor<float> convert_from_symmetric(const SimpleTensor<T> &src); |
| 157 | |
| 158 | /** Convert float simple tensor into quantized using specified quantization information. |
| 159 | * |
| 160 | * @param[in] src Float tensor. |
| 161 | * @param[in] quantization_info Quantification information. |
ramy.elgammal@arm.com | a2561f0 | 2023-06-16 20:45:48 +0100 | [diff] [blame] | 162 | * \relates arm_compute::test::SimpleTensor |
Manuel Bottini | 3689fcd | 2019-06-14 17:18:12 +0100 | [diff] [blame] | 163 | * @return Quantized tensor. |
| 164 | */ |
| 165 | template <typename T> |
| 166 | SimpleTensor<T> convert_to_symmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info); |
| 167 | |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 168 | /** Matrix multiply between 2 float simple tensors |
| 169 | * |
| 170 | * @param[in] a Input tensor A |
| 171 | * @param[in] b Input tensor B |
| 172 | * @param[out] out Output tensor |
| 173 | * |
| 174 | */ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 175 | template <typename T> |
| 176 | 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] | 177 | |
| 178 | /** Transpose matrix |
| 179 | * |
| 180 | * @param[in] in Input tensor |
| 181 | * @param[out] out Output tensor |
| 182 | * |
| 183 | */ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 184 | template <typename T> |
| 185 | void transpose_matrix(const SimpleTensor<T> &in, SimpleTensor<T> &out); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 186 | |
| 187 | /** Get a 2D tile from a tensor |
| 188 | * |
| 189 | * @note In case of out-of-bound reads, the tile will be filled with zeros |
| 190 | * |
| 191 | * @param[in] in Input tensor |
| 192 | * @param[out] tile Tile |
| 193 | * @param[in] coord Coordinates |
| 194 | */ |
| 195 | template <typename T> |
| 196 | void get_tile(const SimpleTensor<T> &in, SimpleTensor<T> &tile, const Coordinates &coord); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 197 | |
| 198 | /** Fill with zeros the input tensor in the area defined by anchor and shape |
| 199 | * |
| 200 | * @param[in] in Input tensor to fill with zeros |
| 201 | * @param[out] anchor Starting point of the zeros area |
| 202 | * @param[in] shape Ending point of the zeros area |
| 203 | */ |
| 204 | template <typename T> |
| 205 | void zeros(SimpleTensor<T> &in, const Coordinates &anchor, const TensorShape &shape); |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 206 | |
| 207 | /** Helper function to compute quantized min and max bounds |
| 208 | * |
| 209 | * @param[in] quant_info Quantization info to be used for conversion |
| 210 | * @param[in] min Floating point minimum value to be quantized |
| 211 | * @param[in] max Floating point maximum value to be quantized |
| 212 | */ |
| 213 | std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max); |
Georgios Pinitas | dbdea0d | 2019-10-16 19:21:40 +0100 | [diff] [blame] | 214 | |
Georgios Pinitas | 6e1791b | 2019-12-02 19:01:25 +0000 | [diff] [blame] | 215 | /** Helper function to compute asymmetric quantized signed min and max bounds |
| 216 | * |
| 217 | * @param[in] quant_info Quantization info to be used for conversion |
| 218 | * @param[in] min Floating point minimum value to be quantized |
| 219 | * @param[in] max Floating point maximum value to be quantized |
| 220 | */ |
| 221 | std::pair<int, int> get_quantized_qasymm8_signed_bounds(const QuantizationInfo &quant_info, float min, float max); |
| 222 | |
Georgios Pinitas | dbdea0d | 2019-10-16 19:21:40 +0100 | [diff] [blame] | 223 | /** Helper function to compute symmetric quantized min and max bounds |
| 224 | * |
| 225 | * @param[in] quant_info Quantization info to be used for conversion |
| 226 | * @param[in] min Floating point minimum value to be quantized |
| 227 | * @param[in] max Floating point maximum value to be quantized |
| 228 | * @param[in] channel_id Channel id for per channel quantization info. |
| 229 | */ |
| 230 | std::pair<int, int> get_symm_quantized_per_channel_bounds(const QuantizationInfo &quant_info, float min, float max, size_t channel_id = 0); |
Giorgio Arena | 63825e8 | 2021-03-25 14:54:50 +0000 | [diff] [blame] | 231 | |
Giorgio Arena | ebbb6f9 | 2021-04-13 09:52:18 +0100 | [diff] [blame] | 232 | /** Add random padding along the X axis (between 1 and 16 columns per side) to all the input tensors. |
| 233 | * This is used in our validation suite in order to simulate implicit padding addition after configuring, but before allocating. |
Giorgio Arena | 63825e8 | 2021-03-25 14:54:50 +0000 | [diff] [blame] | 234 | * |
Manuel Bottini | f733e03 | 2021-05-19 16:15:36 +0100 | [diff] [blame] | 235 | * @param[in] tensors List of tensors to add padding to |
| 236 | * @param[in] data_layout (Optional) Data layout of the operator |
| 237 | * @param[in] only_right_pad (Optional) Only right padding testing, in case of cl image padding |
Giorgio Arena | 63825e8 | 2021-03-25 14:54:50 +0000 | [diff] [blame] | 238 | * |
| 239 | * @note This function adds padding to the input tensors only if data_layout == DataLayout::NHWC |
| 240 | */ |
Manuel Bottini | f733e03 | 2021-05-19 16:15:36 +0100 | [diff] [blame] | 241 | void add_padding_x(std::initializer_list<ITensor *> tensors, const DataLayout &data_layout = DataLayout::NHWC, bool only_right_pad = false); |
Gian Marco Iodice | 72b5687 | 2021-06-29 10:08:46 +0100 | [diff] [blame] | 242 | |
Gunes Bayir | dfcd41a | 2023-10-11 09:56:05 +0100 | [diff] [blame] | 243 | /** For 2d convolution, given the Lhs/Rhs matrix quantization informations and the convolution dimension, |
| 244 | * calculate a suitable output quantization and suggested bias range for obtaining non-saturated outputs with high probability. |
| 245 | * |
| 246 | * @param[in] in_q_info Input matrix quantization info |
| 247 | * @param[in] weight_q_info Weights matrix quantization info |
| 248 | * @param[in] height Height of the weights tensor |
| 249 | * @param[in] width Width of the weights tensors |
| 250 | * @param[in] channels Number of input channels |
| 251 | * @param[in] data_type data type, only QASYMM8, QASYMM8_SIGNED are supported |
| 252 | * @param[in] bias_fraction see @ref suggest_mac_dst_q_info_and_bias() for explanation |
| 253 | * |
| 254 | * @return QuantizationHint object containing the suggested output quantization info and min/max bias range |
| 255 | */ |
| 256 | QuantizationHint suggest_conv_dst_q_info_and_bias(const QuantizationInfo &in_q_info, |
| 257 | const QuantizationInfo &weight_q_info, |
| 258 | int32_t height, |
| 259 | int32_t width, |
| 260 | int32_t channels, |
| 261 | DataType data_type, |
| 262 | float bias_fraction); |
| 263 | |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 264 | /** For a matrix multiplication, given the Lhs/Rhs matrix quantization informations and the matrix multiplication dimensions, |
| 265 | * calculate a suitable output quantization and suggested bias range for obtaining non-saturated outputs with high probability. |
| 266 | * |
| 267 | * @param[in] lhs_q_info Lhs matrix quantization info |
| 268 | * @param[in] rhs_q_info Rhs matrix quantization info |
| 269 | * @param[in] m Number of rows of Lhs matrix |
| 270 | * @param[in] n Number of columns of Rhs Matrix |
| 271 | * @param[in] k Number of rows/columns of Rhs/Lhs Matrix |
| 272 | * @param[in] data_type data type, only QASYMM8, QASYMM8_SIGNED are supported |
Gunes Bayir | dfcd41a | 2023-10-11 09:56:05 +0100 | [diff] [blame] | 273 | * @param[in] bias_fraction see @ref suggest_mac_dst_q_info_and_bias() for explanation |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 274 | * |
| 275 | * @return QuantizationHint object containing the suggested output quantization info and min/max bias range |
Gunes Bayir | 9d0c4de | 2023-04-13 18:22:58 +0100 | [diff] [blame] | 276 | */ |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 277 | QuantizationHint suggest_matmul_dst_q_info_and_bias(const QuantizationInfo &lhs_q_info, |
| 278 | const QuantizationInfo &rhs_q_info, int32_t m, int32_t n, int32_t k, DataType data_type, |
| 279 | float bias_fraction); |
| 280 | |
| 281 | /** For a multiply-accumulate (mac), given the Lhs/Rhs vector quantization informations and the dot product dimensions, |
| 282 | * calculate a suitable output quantization and suggested bias range for obtaining non-saturated outputs with high probability. |
| 283 | * |
| 284 | * @param[in] lhs_q_info Lhs matrix quantization info |
| 285 | * @param[in] rhs_q_info Rhs matrix quantization info |
| 286 | * @param[in] k number of accumulations taking place in the sum, i.e. c_k = sum_k(a_k * b_k) |
| 287 | * @param[in] data_type data type, only QASYMM8, QASYMM8_SIGNED are supported |
| 288 | * @param[in] bias_fraction the fraction of bias amplitude compared to integer accummulation. |
Mohammed Suhail Munshi | 02c452f | 2023-10-26 00:14:36 +0100 | [diff] [blame] | 289 | * @param[in] num_sd (Optional) number of standard deviations we allow from the mean. Default value is 2. |
Gunes Bayir | 532ce2c | 2023-09-14 09:13:49 +0100 | [diff] [blame] | 290 | * |
| 291 | * @return QuantizationHint object containing the suggested output quantization info and min/max bias range |
| 292 | */ |
| 293 | QuantizationHint suggest_mac_dst_q_info_and_bias(const QuantizationInfo &lhs_q_info, |
Mohammed Suhail Munshi | 02c452f | 2023-10-26 00:14:36 +0100 | [diff] [blame] | 294 | const QuantizationInfo &rhs_q_info, int32_t k, DataType data_type, float bias_fraction, |
| 295 | int num_sd = 2); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 296 | } // namespace validation |
| 297 | } // namespace test |
| 298 | } // namespace arm_compute |
Anitha Raj | b566b6e | 2023-08-23 11:40:06 +0100 | [diff] [blame] | 299 | #endif // ACL_TESTS_VALIDATION_HELPERS_H |