diff options
author | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-12-03 15:21:36 +0000 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2020-12-07 14:54:45 +0000 |
commit | 6f72526b3c74c0e64075563be2ddf7f9708ad12c (patch) | |
tree | 34bd513e6a2fa1b96b72682589be3351c0ddf98c /ethosu/vela/stats_writer.py | |
parent | 1e05afa473cf2ca08d2a3464dae6bd2809913c83 (diff) | |
download | ethos-u-vela-6f72526b3c74c0e64075563be2ddf7f9708ad12c.tar.gz |
MLBEDSW-3685 Fix dangerous default value usage
Pylint W0102:
When a mutable value as list or dictionary is detected in a
default value for an argument.
Replace detected instances with None, and upon checking for None, sets
the default accordingly
Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com>
Change-Id: I4eb73d07d01d4cdefa586eb71b9c76746eee3b11
Diffstat (limited to 'ethosu/vela/stats_writer.py')
-rw-r--r-- | ethosu/vela/stats_writer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ethosu/vela/stats_writer.py b/ethosu/vela/stats_writer.py index e4b81561..494b25e7 100644 --- a/ethosu/vela/stats_writer.py +++ b/ethosu/vela/stats_writer.py @@ -236,7 +236,7 @@ def print_performance_metrics_for_strat( num_passes, num_cascaded_passes, n_operations=0, - cpu_operations=[], + cpu_operations=None, bits_per_element=None, show_cpu_operations=False, f=sys.stdout, @@ -284,6 +284,9 @@ def print_performance_metrics_for_strat( print(file=f) print("{:d} passes fused into {:d}".format(num_passes, num_cascaded_passes), file=f) + if cpu_operations is None: + cpu_operations = [] + n_cpu_operations = len(cpu_operations) if n_operations > 0: print( |