aboutsummaryrefslogtreecommitdiff
path: root/ethosu
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu')
-rw-r--r--ethosu/vela/architecture_allocator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/architecture_allocator.py b/ethosu/vela/architecture_allocator.py
index b5edcabb..9cc22bb4 100644
--- a/ethosu/vela/architecture_allocator.py
+++ b/ethosu/vela/architecture_allocator.py
@@ -330,7 +330,7 @@ def find_block_config(
# Scale relative to every output OFM element
if npu_op_type == NpuBlockType.ElementWise:
- relative_cost = ofm_shape.elements() / (height * width * depth)
+ relative_cost = max(ofm_shape.elements() / (height * width * depth), 1)
else:
relative_cost = (ifm_fetch + weight_fetch) / ofm_shape.elements()