diff options
author | Tim Hall <tim.hall@arm.com> | 2022-08-25 13:38:50 +0100 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2022-08-25 13:38:50 +0100 |
commit | 1bbd06bf538ff9d290e9703b6bac05b9617f2ab0 (patch) | |
tree | a87dcdcf06239c0bea8e1c1ee662a43fa4656605 /ethosu | |
parent | 77f0e54f739b31105d4f850a644a33efb3cbcf1f (diff) | |
download | ethos-u-vela-1bbd06bf538ff9d290e9703b6bac05b9617f2ab0.tar.gz |
- 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
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/stats_writer.py | 2 |
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) |