Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix MHAEinsum weight dimension bug when d_in != d_out (#857)#893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@aviralgarg05
Copy link
Contributor

Previously MHAEinsum initialized weight matrices with shape (d_out, d_in) and used inappropriate einsum notation, causing failures for non-square input-output dimensions. This commit corrects weight initialization to shape (d_in, d_out), updates einsum notation to 'bnd,do->bno', and adds three unit tests to verify parity across different d_in and d_out settings. All tests pass successfully.

Fixing the issue#857

rasbt reacted with heart emoji
Previously MHAEinsum initialized weight matrices with shape (d_out, d_in) and used inappropriate einsum notation, causing failures for non-square input-output dimensions. This commit corrects weight initialization to shape (d_in, d_out), updates einsum notation to 'bnd,do->bno', and adds three unit tests to verify parity across different d_in and d_out settings. All tests pass successfully.
@review-notebook-app
Copy link

Check out this pull request on ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered byReviewNB

@rasbt
Copy link
Owner

Thanks a lot for the PR and sorry about the late response, I was out of town last week. I'll have a look soon.

@rasbt
Copy link
Owner

The fix looks great, and thanks for adding those tests. I just moved over the tests to a separate python script for pytest similar to what I've done with some other notebooks here. This way, it's easier to test via the CI runners, and it keeps the code notebook more readable.

Copy link
Owner

@rasbtrasbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Overall looks good to me, thanks for the PR!

.gitignore Outdated


#Ignore vscode AI rules
.github/instructions/codacy.instructions.md
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I just saw this newly added entry, I assume this is for people using vibe code apps? Maybe this can be removed as it's not related to the PR.

@rasbtrasbt merged commit27d52d6 intorasbt:mainNov 1, 2025
13 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@rasbtrasbtrasbt approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@aviralgarg05@rasbt

[8]ページ先頭

©2009-2025 Movatter.jp