I looked at your code and I see that the difference between using GRU/LSTM and bidirectiornal is the hidden dimension, which should be multiplied by the number of direction (1 or 2).
I am also doing the same in my code but not sure why it’s not working. Will have to check again I guess…