Thank you so much, man!! It just worked. But there is another error, can you help me with this? :light_smile:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-75-95f5d8615326> in <module>()
----> 1 output, loss = train(rnn, learning_rate, optimizer, criterion, input_tensor, target)

<ipython-input-71-ebb92fd662bb> in train(rnn, learning_rate, optimizer, criterion, input_tensor, target_tensor)
     51         print(output.size(), target_tensor[i])
     52         loss = criterion(output, target_tensor[i])
---> 53         loss.backward()
     54         optimizer.step()
     55     return output, loss.data[0] / input_tensor.size()[0]

D:\Anaconda3\lib\site-packages\torch\autograd\variable.py in backward(self, gradient, retain_variables)
    142                 raise TypeError("gradient has to be a Tensor, Variable or None")
    143             gradient = Variable(gradient, volatile=True)
--> 144         self._execution_engine.run_backward((self,), (gradient,), retain_variables)
    145 
    146     def register_hook(self, hook):

D:\Anaconda3\lib\site-packages\torch\autograd\function.py in apply(self, *args)
     88 
     89     def apply(self, *args):
---> 90         return self._forward_cls.backward(self, *args)
     91 
     92 

D:\Anaconda3\lib\site-packages\torch\nn\_functions\linear.py in backward(ctx, grad_output)
     19     @staticmethod
     20     def backward(ctx, grad_output):
---> 21         input, weight, bias = ctx.saved_variables
     22 
     23         grad_input = grad_weight = grad_bias = None

RuntimeError: Trying to backward through the graph second time, but the buffers have already been freed. Please specify retain_variables=True when calling backward for the first time.