Skip to content

Commit 4cd7201

Browse files
rascaniclaude
andcommitted
Cortex-M backend: fix avg_pool2d substitution function signature
Use `dialect_pass: AtenToDialectPass` parameter matching the SubstitutionFn type updated in #19676. The `exported_program` parameter caused a mypy arg-type error when both #19676 and #19825 landed on main. Fixes the lintrunner-mypy failure on main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23b6ba0 commit 4cd7201

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backends/cortex_m/passes/aten_to_cortex_m_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,11 +648,12 @@ def _get_bmm_replacement(
648648

649649
@AtenToCortexMPass.register_dialect_substitution(exir_ops.edge.aten.avg_pool2d.default)
650650
def _get_avg_pool2d_replacement(
651-
node: Node, exported_program: ExportedProgram
651+
node: Node, dialect_pass: AtenToDialectPass
652652
) -> DialectNodeSpec | None:
653653
if not _has_qparams(node):
654654
return None
655655

656+
exported_program = dialect_pass.exported_program
656657
pool_args = node.args
657658
kernel_size = cast(list[int], pool_args[1])
658659
stride = cast(list[int], pool_args[2]) if len(pool_args) > 2 else list(kernel_size)

0 commit comments

Comments
 (0)