Skip to content

Fix PatchEmbed input size assertions - #146

Open
cupkk wants to merge 1 commit into
OpenDCAI:mainfrom
cupkk:fix-sana-patch-embed-assertions
Open

Fix PatchEmbed input size assertions#146
cupkk wants to merge 1 commit into
OpenDCAI:mainfrom
cupkk:fix-sana-patch-embed-assertions

Conversation

@cupkk

@cupkk cupkk commented Jul 27, 2026

Copy link
Copy Markdown

The height and width checks in PatchEmbed.forward currently assert a non-empty tuple, so they always pass even when the input shape is wrong.

This changes both statements to use the assertion message as the second assert operand. Invalid image dimensions now reach the intended AssertionError before convolution.

Validation:

  • python3 -W error::SyntaxWarning -m py_compile src/openworldlib/synthesis/visual_generation/sana/sana_wm/sana_wm_diffusion/model/nets/sana_blocks.py
  • AST check confirming both assertion tests are comparison expressions and retain messages

Copilot AI review requested due to automatic review settings July 27, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants