aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hall <tim.hall@arm.com>2022-08-25 13:38:50 +0100
committerTim Hall <tim.hall@arm.com>2022-08-25 13:38:50 +0100
commit1bbd06bf538ff9d290e9703b6bac05b9617f2ab0 (patch)
treea87dcdcf06239c0bea8e1c1ee662a43fa4656605
parent77f0e54f739b31105d4f850a644a33efb3cbcf1f (diff)
downloadethos-u-vela-3.5.0.rc4.tar.gz
MLBEDSW-6879: TFLG pass-through test crash3.5.0.rc43.5.0
- The optimisation of the SHAPE operator resulted in a divide by zero when printing the percentage of npu/cpu operators in the final output summary - The fix is to detect when there are no operators in the output tflite and then avoid the division Signed-off-by: Tim Hall <tim.hall@arm.com> Change-Id: I5bd2342335e9468a8b7028e6e2291a03960e2e55
-rw-r--r--ethosu/vela/stats_writer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/stats_writer.py b/ethosu/vela/stats_writer.py
index 22605a6b..f3e2dbac 100644
--- a/ethosu/vela/stats_writer.py
+++ b/ethosu/vela/stats_writer.py
@@ -277,7 +277,7 @@ def print_performance_metrics_for_strat(
n_cpu_operations = len(cpu_operations)
n_npu_operations = len(npu_operations)
- n_total_operations = n_cpu_operations + n_npu_operations
+ n_total_operations = max(n_cpu_operations + n_npu_operations, 1) # avoid potential divide by zero
def format_tens_list(lst):
return " ".join(str(list(tens.shape)) for tens in lst)