The encoder doesn’t consist of a hidden_dim number of GRU cells. The input length is not related to hidden_dim
hidden_dim is the size of the hidden state you desire, and is a result of matrix multiplications on your input. Your input of shape (batch_size, seq_len, num_features) will result in GRU output shape of (batch_size, seq_len, hidden_dim)