This line of code increases the batch size, which would be wrong:
out = out.reshape(-1, self.hidden_dim)

Depending on your use case, you might want to pass the last time step to the linear layer via:
out = self.fc(out[:, -1, :])

instead or reduce the temporal dimension in any other way.