aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite_writer.py
diff options
context:
space:
mode:
authorMichael McGeagh <michael.mcgeagh@arm.com>2020-12-02 12:39:03 +0000
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-12-08 14:58:19 +0000
commitf3e3ad746de943e312c290d614184c0f6559ac1f (patch)
tree44f6eac5a6b1aec4114ad2c2faddced820ea1e17 /ethosu/vela/tflite_writer.py
parentd9c2c4258c50f04ef3a6c3849508d317249e8ebf (diff)
downloadethos-u-vela-f3e3ad746de943e312c290d614184c0f6559ac1f.tar.gz
MLBEDSW-2836 Change sets to tuples
Replace conditional checks against sets with tuples. If not requiring uniqueness, or complex set operations, it is quicker to use tuples instead. Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com> Change-Id: Ie8732c8d46067244963936c53f0ec81adda50372
Diffstat (limited to 'ethosu/vela/tflite_writer.py')
-rw-r--r--ethosu/vela/tflite_writer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py
index e82fb5e4..f747d471 100644
--- a/ethosu/vela/tflite_writer.py
+++ b/ethosu/vela/tflite_writer.py
@@ -76,7 +76,7 @@ class TFLiteSerialiser:
self.scratch_fast_buf_id = 1 # Always assign scratch_fast to buffer 1
self.buffers_to_write = [] # have an empty array there
- self.ops_to_ignore = set((Op.Const, Op.Placeholder, Op.SubgraphInput))
+ self.ops_to_ignore = (Op.Const, Op.Placeholder, Op.SubgraphInput)
self.tensors_to_reshape = {}
@@ -405,7 +405,7 @@ class TFLiteSerialiser:
# Ensure that the order of the offsets match the order of the tensors
for tens, idx in self.tensor_map.items():
# Set offsets for tensor allocated in Tensor Arena or in the scratch_fast area
- if tens.mem_type in set((MemType.Scratch, MemType.Scratch_fast)):
+ if tens.mem_type in (MemType.Scratch, MemType.Scratch_fast):
offsets[idx] = np.int32(tens.address) if tens.address is not None else np.int32(0)
self.nng.metadata.append(("OfflineMemoryAllocation", np.array([version, subgraph_idx, nbr_tensors] + offsets)))