Skip to content

Commit 850e17f

Browse files
rhilkensdzakhar
authored andcommitted
[convert] float casts
[Change] - Without these cast, MSVC gives errors
1 parent 32123b8 commit 850e17f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/helpers/src/impl/mli_hlp_convert_tensor_ref.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ mli_status convert_float_data(const mli_tensor * src, mli_tensor * dst, convert_
200200
int8_t frac_bits = mli_hlp_tensor_scale_shift(tensor, scale_idx);
201201
float scale = (float) mli_hlp_tensor_scale(tensor, scale_idx);
202202
if (mode == mli::hlp::QUANTIZE) {
203-
scale = 1.0 / scale;
204-
scale_val = ldexp(scale, ((int32_t) frac_bits));
203+
scale = 1.0f / scale;
204+
scale_val = (float)ldexp(scale, ((int32_t) frac_bits));
205205
} else {
206-
scale_val = ldexp(scale, -((int32_t) frac_bits));
206+
scale_val = (float)ldexp(scale, -((int32_t) frac_bits));
207207
}
208208

209209
int16_t zero_offset = mli_hlp_tensor_zero_offset(tensor, scale_idx);

0 commit comments

Comments
 (0)