I’m not sure, how your PyTorch model is defined as you’ve only posted the Keras model.
From the error message it seems you have a size mismatch in your linear layers somewhere.
If you run your model on the CPU, you will most likely get a better error message.