Skip to content

Commit 2b9dda4

Browse files
committed
Refactor bias removal logic to directly use operation inputs, improving efficiency in _RemoveZeroBiasBase class
1 parent 8ef6c41 commit 2b9dda4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

onnxscript/rewriter/rules/common/_remove_zero_bias.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ def rewrite(self, op: ir.tape.Tape, out: ir.Value, **_) -> ir.Value:
2121
"""Remove the bias input from the operation."""
2222
node = out.producer()
2323

24-
# Filter out the bias parameter and keep all other inputs
25-
inputs = []
26-
for param_name, param_value in _.items():
27-
if param_name != "b": # 'b' is the bias parameter
28-
inputs.append(param_value)
29-
3024
return op.op(
3125
self.op_type,
32-
inputs=inputs,
26+
inputs=node.inputs[:-1],
3327
attributes=node.attributes,
3428
domain=node.domain,
3529
)

0 commit comments

Comments
 (0)