Skip to content

Fix QueryPreAttentionNormalisation docstring to describe query scaling - #760

Open
PratikDhanave wants to merge 1 commit into
google-deepmind:mainfrom
PratikDhanaveFork:fix/query-pre-attn-norm-docstring
Open

Fix QueryPreAttentionNormalisation docstring to describe query scaling#760
PratikDhanave wants to merge 1 commit into
google-deepmind:mainfrom
PratikDhanaveFork:fix/query-pre-attn-norm-docstring

Conversation

@PratikDhanave

Copy link
Copy Markdown

QueryPreAttentionNormalisation (in gemma/gm/nn/_config.py and gemma/gm/nn/gemma3n/_config.py) is documented as """Initialization strategy.""", but every enum member selects how the query is scaled before attention (BY_ONE_OVER_SQRT_HEAD_DIM, BY_EMBED_DIM_DIV_NUM_HEADS, BY_ONE_OVER_SQRT_EMBED_DIM_DIV_NUM_HEADS, NONE) — nothing to do with initialization. The docstring appears copy-pasted from an unrelated enum. Replace it with """Query pre-attention scaling strategy.""". Docstring only; no behavior change.

The enum's docstring read 'Initialization strategy.', but every member
(BY_ONE_OVER_SQRT_HEAD_DIM, BY_EMBED_DIM_DIV_NUM_HEADS, ...) selects how the
query is scaled before attention -- unrelated to initialization. The line
appears copy-pasted; replace with an accurate description.
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