fix(embedding): reject incompatible concat sequence mixes - #269
Draft
linhongyu510 wants to merge 1 commit into
Draft
fix(embedding): reject incompatible concat sequence mixes#269linhongyu510 wants to merge 1 commit into
linhongyu510 wants to merge 1 commit into
Conversation
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.
Pull Request / 拉取请求
What does this PR do? / 这个 PR 做了什么?
SequenceFeature(pooling="concat")preserves the sequence axis, so its embedding has shape[B, 1, L, D]. Sparse and mean/sum-pooled sequence embeddings have shape[B, 1, D]. Passing both kinds in oneEmbeddingLayercall currently reachestorch.catand fails with:This PR:
ValueErrornaming both concat-pooled and incompatible features;[B, H, L, D];squeeze_dim=True;The change intentionally does not implement dynamic embedding-dimension concatenation from the original issue title.
Type of Change / 变更类型
Related Issues / 相关 Issues
Related to #226.
How to Test / 如何测试
Environment:
pyproject.tomlThe broad suite skipped tests that explicitly require uninstalled optional ONNX or Transformers dependencies, plus existing complex-model skips. No executed test failed. The repository CI remains authoritative for the complete optional-dependency matrix and cross-platform checks.
Checklist / 检查清单