aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/weight_compressor.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/weight_compressor.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/weight_compressor.py')
-rw-r--r--ethosu/vela/weight_compressor.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py
index 40ebcd04..fce17d19 100644
--- a/ethosu/vela/weight_compressor.py
+++ b/ethosu/vela/weight_compressor.py
@@ -535,8 +535,7 @@ def update_pass_weight_and_scale_tensors(nng, arch):
if ps.scale_tensor is not None:
rescale_for_faf = False
- activation_ops = set((Op.Sigmoid, Op.Tanh))
- if (ps.ops[-1].type in activation_ops) and (ps.npu_block_type != NpuBlockType.ElementWise):
+ if (ps.ops[-1].type in (Op.Sigmoid, Op.Tanh)) and (ps.npu_block_type != NpuBlockType.ElementWise):
rescale_for_faf = True
calc_scales_and_pack_biases(ps.scale_tensor, arch, ofm_depth_step, rescale_for_faf)
if ps.scale_tensor.ops[0].type == Op.DMA: