{{ message }}
Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Preserve the learned weight when a TorchScript
nn.LayerNormomits bias. Set the affine flag from the weight attribute and synthesize a zero bias with the same shape and type, keeping the existing PNNX/native representation and ordinary affine/non-affine behavior.Closes #7127.
Validation: the complete existing PNNX and native LayerNorm programs pass with added one-dimensional and multidimensional missing-bias regressions; both related functional LayerNorm programs pass. On the baseline, the original normal outputs pass before each first added case fails. A separate 9-model public matrix changes from 6 normal / 3 wrong to all correct in both PNNX and native paths, with all 24 normal param/bin artifacts unchanged. An independent 8-model matrix also passes after the fix, with normal artifacts and outputs unchanged; these matrices overlap and are not added together.
Tested on Windows CPU, Python 3.14 and Torch 2.11 with newly built converter and current CPU Python binding, using cached dependencies. The tests set
bias=Noneafter construction to avoid requiring the newer constructor keyword on older Torch versions; the public matrix usesbias=False. Native cross-channel normalization remains an existing limitation. No full suite, other OS, GPU, PT2, ONNX frontend or performance claim.