diff --git a/neural_compressor/adaptor/ox_utils/operators/attention.py b/neural_compressor/adaptor/ox_utils/operators/attention.py index 9e12f57b3a2..840470b194a 100644 --- a/neural_compressor/adaptor/ox_utils/operators/attention.py +++ b/neural_compressor/adaptor/ox_utils/operators/attention.py @@ -60,8 +60,7 @@ def convert(self, convert_format): inputs.extend(quantized_name) inputs.append(node.input[2]) inputs.extend(scale) - if len(node.input) > 3: - inputs.append(node.input[3]) + inputs.append(node.input[3] if len(node.input) > 3 else "") inputs.extend(zp) if len(node.input) > 4: inputs.append(node.input[4]) @@ -74,4 +73,4 @@ def convert(self, convert_format): node.name, **kwargs) self.quantizer.new_nodes.append(qattention_node) - self.quantizer.remove_nodes.append(node) \ No newline at end of file + self.quantizer.remove_nodes.append(node)