aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/test/testutil.py
diff options
context:
space:
mode:
authorMichael McGeagh <michael.mcgeagh@arm.com>2020-12-03 15:21:36 +0000
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-12-07 14:54:45 +0000
commit6f72526b3c74c0e64075563be2ddf7f9708ad12c (patch)
tree34bd513e6a2fa1b96b72682589be3351c0ddf98c /ethosu/vela/test/testutil.py
parent1e05afa473cf2ca08d2a3464dae6bd2809913c83 (diff)
downloadethos-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/test/testutil.py')
-rw-r--r--ethosu/vela/test/testutil.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ethosu/vela/test/testutil.py b/ethosu/vela/test/testutil.py
index 4b2938b9..9ba39bc5 100644
--- a/ethosu/vela/test/testutil.py
+++ b/ethosu/vela/test/testutil.py
@@ -107,11 +107,12 @@ def create_op_with_quant_tensors(
return op
-def create_op(op_type, inputs, output, attrs=dict()):
+def create_op(op_type, inputs, output, attrs=None):
op = Operation(op_type, output.name + "_op")
op.inputs = inputs
op.outputs = [output]
- op.attrs = attrs
+ if attrs is not None:
+ op.attrs = attrs
return op