Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Linear to rename In and Out to avoid conflicting names (fixes #53) #109

Closed

Conversation

cooljoseph1
Copy link
Contributor

It's a pretty small pull request. The only changes are to src/haliax/nn/linear.py and an added test at tests/test_nn.py.

The change in linear.py is to make Linear rename the In axis name(s) to end in "_in" and the Out axis name(s) to end in "_out" when creating the weight/bias tensors. When Linear is called, it now renames the inputs and outputs accordingly.

The added test in test_nn.py makes sure that a Linear module can be created with conflicting axes' names in In and Out.

@cooljoseph1 cooljoseph1 changed the title Changed Linear to rename In and Out to avoid conflicting names (fixes Issue #53) Changed Linear to rename In and Out to avoid conflicting names (Closes #53) Sep 4, 2024
@cooljoseph1 cooljoseph1 changed the title Changed Linear to rename In and Out to avoid conflicting names (Closes #53) Changed Linear to rename In and Out to avoid conflicting names (fixes #53) Sep 4, 2024
@cooljoseph1
Copy link
Contributor Author

fixes #53

@dlwh
Copy link
Member

dlwh commented Sep 4, 2024

thanks for doing this. I kind of think the way it was originally specced is the correct way, b/c of sharding, but I'm willing to be convinced

@dlwh dlwh closed this Dec 4, 2024
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.

2 participants