Skip to content

Commit ebf4c12

Browse files
authored
Replace conv_transpose optional bias with zero bias
Differential Revision: D83517548 Pull Request resolved: pytorch#14676
1 parent 68b2d3c commit ebf4c12

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backends/cadence/aot/replace_ops.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,17 @@ class ReplaceConvolutionOptionalArgsWithConcreteArgsPass(ExportPass):
438438
"""
439439

440440
def call_operator(self, op, args, kwargs, meta):
441-
if get_edge_overload_packet(op) != exir_ops.edge.cadence.convolution:
441+
op_packet = get_edge_overload_packet(op)
442+
if op_packet not in {
443+
exir_ops.edge.cadence.convolution,
444+
exir_ops.edge.cadence.transposed_convolution,
445+
}:
442446
return super().call_operator(op, args, kwargs, meta)
443447

448+
is_transposed = op_packet == exir_ops.edge.cadence.transposed_convolution
449+
expected_args = 9 if is_transposed else 8
450+
assert len(args) == expected_args
444451
# Check if the bias is already concrete
445-
assert len(args) == 8
446452
if args[2] is not None:
447453
return super().call_operator(op, args, kwargs, meta)
448454

0 commit comments

Comments
 (0)