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

Layer fails on inputs that have been transposed previously #36

Closed
tRosenflanz opened this issue May 22, 2024 · 1 comment
Closed

Layer fails on inputs that have been transposed previously #36

tRosenflanz opened this issue May 22, 2024 · 1 comment

Comments

@tRosenflanz
Copy link

Using your implementation on the data that has been transposed previously causes a
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. error.
Just replacing

x = x.view(-1, self.in_features)
with a reshape fixed it. Maybe worth to fix this if you want the layer to be a full drop in for nn.Linear

@akaashdash
Copy link
Contributor

Oh I didn't know this was a thing when I made that PR. You learn something new every day.

#37 should fix

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

No branches or pull requests

2 participants