efficient-kan icon indicating copy to clipboard operation
efficient-kan copied to clipboard

Layer fails on inputs that have been transposed previously

Open tRosenflanz opened this issue 1 year ago • 1 comments

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 https://github.com/Blealtan/efficient-kan/blob/605b8c2ae24b8085bd11b96896a17eabe12f6736/src/efficient_kan/kan.py#L156 with a reshape fixed it. Maybe worth to fix this if you want the layer to be a full drop in for nn.Linear

tRosenflanz avatar May 22 '24 17:05 tRosenflanz

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

https://github.com/Blealtan/efficient-kan/pull/37 should fix

akaashdash avatar May 22 '24 22:05 akaashdash