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
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py
index e82fb5e..f747d47 100644
--- a/ethosu/vela/tflite_writer.py
+++ b/ethosu/vela/tflite_writer.py
@@ -76,7 +76,7 @@
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 @@
# 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)))