diff options
Diffstat (limited to 'tests/validation/reference/Convolution3d.h')
-rw-r--r-- | tests/validation/reference/Convolution3d.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/validation/reference/Convolution3d.h b/tests/validation/reference/Convolution3d.h index 23918a4055..6ac5df93b3 100644 --- a/tests/validation/reference/Convolution3d.h +++ b/tests/validation/reference/Convolution3d.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef __ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H__ -#define __ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H__ +#ifndef ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H +#define ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "tests/validation/Helpers.h" @@ -133,7 +133,7 @@ inline void convolution3d(const SimpleTensor<T> &in, const SimpleTensor<TW> &wei int output_multiplier = 0; int output_shift = 0; const float multiplier = input_scale * weights_scale / output_scale; - arm_compute::quantization::calculate_quantized_multiplier_less_than_one(multiplier, &output_multiplier, &output_shift); + arm_compute::quantization::calculate_quantized_multiplier(multiplier, &output_multiplier, &output_shift); const int half_width_weights_start = width_weights / 2; const int half_width_weights_end = ((width_weights % 2) == 0) ? (half_width_weights_start - 1) : half_width_weights_start; @@ -171,9 +171,8 @@ inline void convolution3d(const SimpleTensor<T> &in, const SimpleTensor<TW> &wei // Accumulate the bias acc += (*b_ptr); - acc = validation::asymm_rounding_divide_by_pow2(validation::asymm_int_mult(acc, output_multiplier), output_shift); - acc += output_offset; - acc = utility::clamp<int32_t>(acc, 0, 255); + // Quantize down + acc = validation::quantize_down_scale_by_fixedpoint(acc, output_multiplier, output_shift, output_offset, 0, 255); // Store the result *out_ptr = acc; @@ -182,4 +181,4 @@ inline void convolution3d(const SimpleTensor<T> &in, const SimpleTensor<TW> &wei } // namespace convolution_3d } // namespace test } // namespace arm_compute -#endif /*__ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H__ */ +#endif /* ARM_COMPUTE_TEST_VALIDATION_CONVOLUTION_H */ |