I don’t know how exactly the Keras model is working, so cannot give you a proper answer. E.g. could you explain what the difference in the outputs for the Keras GRU would be if return_sequences is either set to True or False? Also, do the Dense layers automatically apply an activation function without you specifying it? If so, you might want to add this non-linearity to the PyTorch model as well.


Same as number 1.


To properly debug the difference you could store all parameters of the Keras model, load them into the PyTorch model, and compare the outputs of both. If the difference for the same input is larger than the expected error due to the floating point precision, you could then compare the outputs of each layer and narrow down the difference further.