Skip to content

Fix IndexError in fuse_pad_into_conv when Pad carries pads as an attribute - #3074

Open
Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
microsoft:mainfrom
MohammedAlkindi:fix/pad-conv-opset10
Open

Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
microsoft:mainfrom
MohammedAlkindi:fix/pad-conv-opset10

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor

_FuseConvPadBase.check reads pad_node.inputs[1], but Pad before opset 11 carries the pads as an attribute and has one input, so the rule raises IndexError. The rule is in the default set, so optimizer.optimize() fails with a PassError on a checker-valid opset-10 model where a Pad feeds a Conv. The rule now declines that case and leaves the model unchanged.

test_unsupported_fuse_pad_into_conv_with_pads_attribute fails before with the IndexError and passes after. _fuse_pad_into_conv_test.py: 40 passed. ruff check and ruff format --check are clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant