robinbaudisch:

The number of parameters for the keras implementation are:


TF/Keras use the channels-last memory layout so your input has the shape [batch_size, height=2, width=10, channels=25], while PyTorch uses channels-first.
The nn.Conv2d layer is currently using in_channels=2 in PyTorch, which is wrong, so you should change it to in_channels=25 and permute the input to [batch_size, 25, 2, 10].