aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/type_conversion.cc
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2020-10-19 12:35:05 -0700
committerKevin Cheng <kevin.cheng@arm.com>2020-10-19 12:35:05 -0700
commit99bea145a050e12f1b5f8301979713d9a9b04e12 (patch)
treebc53dd8cf4566c22b75404dd5cc4ffb849b358d8 /reference_model/src/ops/type_conversion.cc
parente5e2676409a936431f87d31fb74d825257b20804 (diff)
downloadreference_model-99bea145a050e12f1b5f8301979713d9a9b04e12.tar.gz
Update apply_scale_32()
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: Ida8e3a17d74e5d6379b2244896ddf9e295d0ecc9
Diffstat (limited to 'reference_model/src/ops/type_conversion.cc')
-rw-r--r--reference_model/src/ops/type_conversion.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/reference_model/src/ops/type_conversion.cc b/reference_model/src/ops/type_conversion.cc
index 61a19f4..a97bc0d 100644
--- a/reference_model/src/ops/type_conversion.cc
+++ b/reference_model/src/ops/type_conversion.cc
@@ -130,7 +130,7 @@ int OpRescale<Rank, InDtype, OutDtype>::eval()
curr_channel_slice_prescaled.unaryExpr([input_zp, output_zp, channel_multiplier, channel_shift,
double_round](InEigenType in_val) -> OutEigenType {
InEigenType input_zp_shifted = in_val - (InEigenType)input_zp;
- int32_t scaled = TosaReference::QuantUtil<InDtype>::apply_scale(
+ int32_t scaled = TosaReference::QuantUtil::apply_scale_32(
input_zp_shifted, channel_multiplier, channel_shift, double_round);
OutEigenType out_val = (OutEigenType)(scaled + output_zp);
out_val = std::max<OutEigenType>(out_val, QMin);
@@ -151,8 +151,8 @@ int OpRescale<Rank, InDtype, OutDtype>::eval()
output_2d = input_reshaped.unaryExpr(
[input_zp, output_zp, tensor_multiplier, tensor_shift, double_round](InEigenType in_val) -> OutEigenType {
InEigenType input_zp_shifted = in_val - (InEigenType)input_zp;
- int32_t scaled = TosaReference::QuantUtil<InDtype>::apply_scale(input_zp_shifted, tensor_multiplier,
- tensor_shift, double_round);
+ int32_t scaled = TosaReference::QuantUtil::apply_scale_32(input_zp_shifted, tensor_multiplier,
+ tensor_shift, double_round);
OutEigenType out_val = (OutEigenType)(scaled + output_zp);
out_val = std::max<OutEigenType>(out_val, QMin);
out_val = std::min<OutEigenType>(out_val, QMax);