Skip to content

Fix LayerNormEnsemble.from_layernorm without affine parameters#22

Open
tippered1-debug wants to merge 1 commit into
yandex-research:mainfrom
tippered1-debug:fix-layernorm-ensemble-from-layernorm
Open

Fix LayerNormEnsemble.from_layernorm without affine parameters#22
tippered1-debug wants to merge 1 commit into
yandex-research:mainfrom
tippered1-debug:fix-layernorm-ensemble-from-layernorm

Conversation

@tippered1-debug

Copy link
Copy Markdown

Fixes LayerNormEnsemble.from_layernorm for non-affine nn.LayerNorm.

nn.LayerNorm(..., elementwise_affine=False) has no weight, and the previous fallback accessed module.running_mean, which is not defined for LayerNorm. This caused from_layernorm to fail with AttributeError.

Added a doctest covering the non-affine case.

Checks run:

.venv/bin/python -m xdoctest tabm.py
.venv/bin/python -m ruff check tabm.py
.venv/bin/python -m ruff format --check tabm.py
.venv/bin/python -m py_compile tabm.py

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