From 0bb338458d97f42f90dfe0e699065769bfcdaec0 Mon Sep 17 00:00:00 2001 From: Thibaut Goetghebuer-Planchon Date: Wed, 15 Jan 2025 16:15:20 +0000 Subject: [PATCH] Fix uninitialized variable type-check in FuseQuantizedActivationPass --- backends/arm/_passes/fuse_quantized_activation_pass.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/arm/_passes/fuse_quantized_activation_pass.py b/backends/arm/_passes/fuse_quantized_activation_pass.py index 86836842bb1..4eccea1a143 100644 --- a/backends/arm/_passes/fuse_quantized_activation_pass.py +++ b/backends/arm/_passes/fuse_quantized_activation_pass.py @@ -19,12 +19,13 @@ def _is_fuseable_quantized_activation(self, node: Node): is_fuseable = min_val == 0 is_quantized = len(node.users) == 1 and next(iter(node.users)).target == q_op - if is_quantized: + if is_fuseable and is_quantized: quant_node = next(iter(node.users)) zp = quant_node.args[2] qmin = quant_node.args[3] - - return is_fuseable and is_quantized and zp == qmin + return zp == qmin + else: + return False def _is_fuseable_input(self, node: Node): return (