diff options
author | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2021-01-18 15:21:03 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2021-01-20 14:50:26 +0000 |
commit | e82be7c1a000277b44da7e85c527229a1d5eab2a (patch) | |
tree | d8c1784f938b32fe3233e80fbc5f6ea90ecb321b /ethosu/vela/operation.py | |
parent | db5124c2b5e10b34c61b3e016bb597ba1c1574df (diff) | |
download | ethos-u-vela-e82be7c1a000277b44da7e85c527229a1d5eab2a.tar.gz |
[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 <fredrik.svedberg@arm.com>
Change-Id: I1d286f63890585c06b8a161df1ff77e3f844a4b9
Diffstat (limited to 'ethosu/vela/operation.py')
-rw-r--r-- | ethosu/vela/operation.py | 5 |
1 files changed, 5 insertions, 0 deletions
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) |