Butterfly matrix multiplication in PyTorch