I assume your input has the size [batch_size, seq_len]?
If so, then self.gru would get an input of [batch_size, seq_len, embedded_dim], while it expects an input of [seq_len, batch_size, input_size] in the default setup.
If my assumptions are correct, you could either permute the input or use batch_first=True while creating the nn.GRU, which would then expect an input of [batch_size, seq_len, features].