Skip to content

[cuda_xpu_alignment] GroupNorm with num_groups=0 raises ZeroDivisionError instead of ValueError#32

Draft
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-1
Draft

[cuda_xpu_alignment] GroupNorm with num_groups=0 raises ZeroDivisionError instead of ValueError#32
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-1

Conversation

@Stonepia

Copy link
Copy Markdown
Collaborator

[cuda_xpu_alignment] GroupNorm with num_groups=0 raises ZeroDivisionError instead of ValueError

Fixes https://github.com/intel-sandbox/agentic_xpu/issues/1

Root Cause: In torch/nn/modules/normalization.py:306, the GroupNorm constructor performs num_channels % num_groups before validating that num_groups is positive. When num_groups=0, this raises ZeroDivisionError instead of a clear ValueError.


Diff stat:

torch/nn/modules/normalization.py | 2 ++
 1 file changed, 2 insertions(+)

[cuda_xpu_alignment] GroupNorm with num_groups=0 raises ZeroDivisionError instead of ValueError
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.

1 participant