Currently KANLinear strictly checks the dimensions are (batch_size, in_features). This does not allow compatibility with other input shapes where the feature sizes of the same. On the other hand, nn.Linear allows for any shape where the last dimension matches feature shape, eg: (, in_features), and it will reshape it to match and reshape back to the same (, out_features) on returning. Because of this difference, KANLinear and nn.Linear are currently not interchangeable, prevent people from swapping MLPs with KANs in existing code to explore differences in the two.
This change would allow for better shape compatibility, and therefore allow people to interchange KANLinear (or KAN) with nn.Linear layers.
Currently KANLinear strictly checks the dimensions are (batch_size, in_features). This does not allow compatibility with other input shapes where the feature sizes of the same. On the other hand, nn.Linear allows for any shape where the last dimension matches feature shape, eg: (, in_features), and it will reshape it to match and reshape back to the same (, out_features) on returning. Because of this difference, KANLinear and nn.Linear are currently not interchangeable, prevent people from swapping MLPs with KANs in existing code to explore differences in the two.
This change would allow for better shape compatibility, and therefore allow people to interchange KANLinear (or KAN) with nn.Linear layers.