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/operation.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ethosu/vela/operation.py') diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py index af36587c..844f2985 100644 --- a/ethosu/vela/operation.py +++ b/ethosu/vela/operation.py @@ -219,6 +219,7 @@ class Op(Enum): Relu = OperatorInfo(indices=IFM_INDICES) Relu6 = OperatorInfo(indices=IFM_INDICES) ReluN1To1 = OperatorInfo(indices=IFM_INDICES) + RescaleAdd = OperatorInfo(block_type=NpuBlockType.ElementWise, indices=IFM_IFM2_INDICES) Reshape = OperatorInfo(indices=IFM_INDICES) ResizeBilinear = OperatorInfo(block_type=NpuBlockType.Pooling, indices=IFM_INDICES) ResizeNearestNeighbor = OperatorInfo() @@ -408,6 +409,7 @@ class Operation: "_kernel", "ifm_shapes", "ofm_shapes", + "rescale", ) def __init__(self, op_type: Op, name: str): @@ -431,6 +433,9 @@ class Operation: self._kernel = None self.ifm_shapes: List[Shape4D] = [] self.ofm_shapes: List[Shape4D] = [] + # If not none: contains rescale to be used as output scaling + # (which overrides the ofm tensor's scale) + self.rescale = None def clone(self, suffix="_clone"): res = Operation(self.type, self.name + suffix) -- cgit v1.2.1