From a4f3c0e94bcc0db0a39abfec6481c6921e2c1245 Mon Sep 17 00:00:00 2001 From: chenjian Date: Thu, 14 Apr 2022 21:08:39 +0800 Subject: [PATCH] fix divide zero error when cpu only (#41794) --- python/paddle/profiler/profiler_statistic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/profiler/profiler_statistic.py b/python/paddle/profiler/profiler_statistic.py index e4d4ff8c18..7465a8e80f 100755 --- a/python/paddle/profiler/profiler_statistic.py +++ b/python/paddle/profiler/profiler_statistic.py @@ -869,7 +869,7 @@ def _build_table(statistic_data, '{} / - / - / - / {}'.format( format_time( other_gpu_time, unit=time_unit), - format_ratio(float(other_gpu_time) / gpu_total_time)) + format_ratio(float(other_gpu_time) / total_time)) ] all_row_values.append(row_values) # Calculate the column width -- GitLab