From b6d7cfcdb7012be94a2d7cecbe976e33080cb500 Mon Sep 17 00:00:00 2001 From: Ethan Ng Date: Mon, 29 Sep 2025 17:34:27 -0700 Subject: [PATCH] Replace conv_transpose optional bias with zero bias (#14676) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/14676 Reviewed By: DrJessop Differential Revision: D83517548 --- backends/cadence/aot/replace_ops.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backends/cadence/aot/replace_ops.py b/backends/cadence/aot/replace_ops.py index bf0657315a3..e686f5a3a45 100644 --- a/backends/cadence/aot/replace_ops.py +++ b/backends/cadence/aot/replace_ops.py @@ -438,11 +438,17 @@ class ReplaceConvolutionOptionalArgsWithConcreteArgsPass(ExportPass): """ def call_operator(self, op, args, kwargs, meta): - if get_edge_overload_packet(op) != exir_ops.edge.cadence.convolution: + op_packet = get_edge_overload_packet(op) + if op_packet not in { + exir_ops.edge.cadence.convolution, + exir_ops.edge.cadence.transposed_convolution, + }: return super().call_operator(op, args, kwargs, meta) + is_transposed = op_packet == exir_ops.edge.cadence.transposed_convolution + expected_args = 9 if is_transposed else 8 + assert len(args) == expected_args # Check if the bias is already concrete - assert len(args) == 8 if args[2] is not None: return super().call_operator(op, args, kwargs, meta)