From e82be7c1a000277b44da7e85c527229a1d5eab2a Mon Sep 17 00:00:00 2001 From: Fredrik Svedberg Date: Mon, 18 Jan 2021 15:21:03 +0100 Subject: [MLBEDSW-2787] Remove op.attrs["rescale"] in softmax.py Added RescaleAdd operation to avoid non-standard attribute "rescale" for Add operation. Also changed ResizeBilinear in the same way. Signed-off-by: Fredrik Svedberg Change-Id: I1d286f63890585c06b8a161df1ff77e3f844a4b9 --- ethosu/vela/softmax.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/softmax.py') diff --git a/ethosu/vela/softmax.py b/ethosu/vela/softmax.py index 3b4bace9..8a1770e1 100644 --- a/ethosu/vela/softmax.py +++ b/ethosu/vela/softmax.py @@ -35,6 +35,7 @@ from .operation_util import create_clz from .operation_util import create_depthwise_maxpool from .operation_util import create_mul from .operation_util import create_reduce_sum +from .operation_util import create_rescale_add from .operation_util import create_shl from .operation_util import create_shr from .operation_util import create_sub @@ -331,13 +332,13 @@ class SoftMax: "F0_one_const", [1, 1, 1, 1], DataType.int32, [(1 << 31) - 1], np.int32, quantization=no_scale_quant ) half_denominator = add_op_get_ofm( - create_add( + create_rescale_add( f"{self.op.name}_add{pass_number}", f0_one_const, shifted_sum_minus_one, + (1, 1), # Custom rescale one_scale_quant, activation, - attrs={"rescale": (1, 1)}, ) ) -- cgit v1.2.1