From 4a434cba156cdfb2613b7ebe4d4a4ec9f85ba616 Mon Sep 17 00:00:00 2001 From: Fredrik Svedberg Date: Tue, 27 Sep 2022 14:13:01 +0200 Subject: MLBEDSW-6969 Remove RescaleAdd and RescaleMul operators Removed RescaleAdd and RescaleMul operators in favour of Operation.explicit_scale and removed Operation.rescale. Signed-off-by: Fredrik Svedberg Change-Id: Idccd8851731d4bb8d4e84970e0fd6b409d7d4e45 --- ethosu/vela/tosa_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/tosa_reader.py') diff --git a/ethosu/vela/tosa_reader.py b/ethosu/vela/tosa_reader.py index 2bec9cf1..cd18adb2 100644 --- a/ethosu/vela/tosa_reader.py +++ b/ethosu/vela/tosa_reader.py @@ -23,6 +23,7 @@ import numpy as np from .nn_graph import Graph from .nn_graph import Subgraph +from .operation import ExplicitScaling from .operation import Op from .operation import Operation from .reader_util import align_tensor_indices_to_nng @@ -183,8 +184,7 @@ class TosaSubgraph: if "shift" in op.attrs and op.type == Op.Mul: shift = op.attrs["shift"] if shift != 0: - op.type = Op.RescaleMul - op.rescale = [1, shift] + op.explicit_scaling = ExplicitScaling(False, [shift], [1]) if op.type.is_depthwise_conv2d_op(): op.attrs["depth_multiplier"] = op.weights.shape[3] if op.type == Op.SplitSliceRead: -- cgit v1.2.1