aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tosa_reader.py
diff options
context:
space:
mode:
authorPatrik Gustavsson <patrik.gustavsson@arm.com>2021-08-25 13:49:25 +0200
committerPatrik Gustavsson <patrik.gustavsson@arm.com>2021-09-03 14:37:43 +0200
commitb081d67f3e96896ea0ca7426a18c5fe153419ee0 (patch)
treea62a36256836b9bebcf318fe71793ad800099267 /ethosu/vela/tosa_reader.py
parentdf99510f04aef99d1b8e9be9bfcde8fc1738b65f (diff)
downloadethos-u-vela-b081d67f3e96896ea0ca7426a18c5fe153419ee0.tar.gz
TOSA: Added support for ADD, SUB and MUL
Added support for ADD, SUB and MUL Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com> Change-Id: I52acdc126b16e2cf4096bcf7a77023ea7d204998
Diffstat (limited to 'ethosu/vela/tosa_reader.py')
-rw-r--r--ethosu/vela/tosa_reader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ethosu/vela/tosa_reader.py b/ethosu/vela/tosa_reader.py
index 268d43ce..2925ab43 100644
--- a/ethosu/vela/tosa_reader.py
+++ b/ethosu/vela/tosa_reader.py
@@ -179,6 +179,11 @@ class TosaSubgraph:
# TODO CONV3D more to be done....
print("Unsupported kernel dimensions: ", len(kernel))
assert False
+ 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]
if op.type.is_depthwise_conv2d_op():
op.attrs["depth_multiplier"] = op.weights.shape[3]
@@ -213,7 +218,6 @@ class TosaSubgraph:
# Initialize quantization parameters
tens.quantization = QuantizationParameters()
- tens.quantization.scale_f32 = 1.0
if dtype == DataType.uint8:
tens.quantization.quant_min = 0
tens.quantization.quant_max = (1 << dtype.bits) - 1