Skip to content

Commit 9e0292f

Browse files
committed
Arm backend: Update Rescale attribute scale32 to be always true for TOSA 1.0
Signed-off-by: Saoirse Stewart <[email protected]> Change-Id: I15018fdf200888712f48ceab35b74b6799149e8d
1 parent efb2235 commit 9e0292f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

backends/arm/tosa_quant_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,9 @@ def build_rescale(
273273
import serializer.tosa_serializer as ts # type: ignore
274274
import tosa.Op as TosaOp # type: ignore
275275

276-
# Check if scale32 mode is used for given output element type
277-
is_scale32 = output_type == ts.DType.INT8
278-
scale_width = 32 if is_scale32 else 16
279276
input_name = input_node.name
280277

281-
multipliers, shifts = compute_multiplier_and_shift(scale, scale_width)
278+
multipliers, shifts = compute_multiplier_and_shift(scale, 32)
282279
rescale_inputs = create_const_ops_for_rescale(
283280
tosa_fb,
284281
input_node.dtype,
@@ -291,7 +288,7 @@ def build_rescale(
291288
)
292289
attr_rescale = ts.TosaSerializerAttribute()
293290
attr_rescale.RescaleAttribute(
294-
scale32=is_scale32,
291+
scale32=True,
295292
rounding_mode=rounding_mode,
296293
per_channel=per_channel,
297294
input_unsigned=False,

0 commit comments

Comments
 (0)