aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tosa_graph_optimiser.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/tosa_graph_optimiser.py')
-rw-r--r--ethosu/vela/tosa_graph_optimiser.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/ethosu/vela/tosa_graph_optimiser.py b/ethosu/vela/tosa_graph_optimiser.py
index c068937..bcb4aac 100644
--- a/ethosu/vela/tosa_graph_optimiser.py
+++ b/ethosu/vela/tosa_graph_optimiser.py
@@ -387,6 +387,8 @@ def rewrite_rescale(op, arch, nng):
ifm.quantization.zero_point = input_zp
ofm.quantization.zero_point = output_zp
+ assert per_channel is False, "per_channel rescale not supported"
+
for s, m in zip(shift, multiplier):
# TODO these are the TOSA limitations
assert m >= 0
@@ -403,11 +405,7 @@ def rewrite_rescale(op, arch, nng):
# Generate Rescale behaviour attached to a compatible NOP
avgpool_op = replace_rescale_with_avg_pool(op)
avgpool_op.rounding_mode = rounding_mode
-
- if per_channel:
- assert False, "per_channel rescale not supported"
- else:
- avgpool_op.explicit_scaling = explicit_scaling
+ avgpool_op.explicit_scaling = explicit_scaling
return op