Skip to content

[BUG] Modify autocasting in fast normalization functions to handle optional weight params safely#2631

Merged
rwightman merged 1 commit intohuggingface:mainfrom
tesfaldet:fix-fast-norm-autocast
Dec 23, 2025
Merged

[BUG] Modify autocasting in fast normalization functions to handle optional weight params safely#2631
rwightman merged 1 commit intohuggingface:mainfrom
tesfaldet:fix-fast-norm-autocast

Conversation

@tesfaldet
Copy link
Copy Markdown
Contributor

A runtime error (AttributeError) occurs when trying to use a fast normalization with affine=False, since an autocast is attempted on the weight argument, which has a value of None.

It just happened to me, and the fix is quite straightforward, so I thought I'd send a PR :)

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rwightman
Copy link
Copy Markdown
Collaborator

@tesfaldet thanks!

@rwightman rwightman merged commit c59c9c1 into huggingface:main Dec 23, 2025
22 checks passed
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.

3 participants