So error message clearly say LSTM cell expect input to be in 3 dimensions not 2
and following the pytorch docs -> input have shape (seq_len, batch, input_size)
So you use .view() method to manipulate ur emmbeding output to have 3d shape with this order (seq_len, batch, input_size)
And this order corresponde to:
seq_len = time dimension (how many time steps do you have)
batch = mini-batch dimension (how much do you split ur data)
input_size = feature dimension (so how many features do you have)
So lets say you have some time series forecasting problem you split your data and you want to predict next 5 time steps using last 5 time steps number of features is 10 and u split ur data into batches of size 10 and total numbers of exaples = 1000.
Your input should have shape -> 5 x 100 x 10
Im not doing much NLP so i cant help you with ur embedding output but u can check it manualy and confirm it here https://pytorch.org/docs/stable/nn.html#torch.nn.Embedding 89
And there are crucial informations about problem

/home/naditya/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.pyc in forward(self, input, hx)
176             flat_weight = None
177
–> 178         self.check_forward_args(input, hx, batch_sizes)
179         func = self._backend.RNN(
180             self.mode,
/home/naditya/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.pyc in check_forward_args(self, input, hidden, batch_sizes)
124             raise RuntimeError(
125                 ‘input must have {} dimensions, got {}’.format(
–> 126                     expected_input_dim, input.dim()))
127         if self.input_size != input.size(-1):
128             raise RuntimeError(
RuntimeError: input must have 3 dimensions, got 2

Thats why i focus on -->  self.check_forward_args(input, hx, batch_sizes) -> cause u fail this check