efficient-kan
efficient-kan copied to clipboard
Layer fails on inputs that have been transposed previously
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
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