title: Problem in Seq2Seq translation model when using fixed embeddings
body: <p>I have already trained a model using this code <a href="https://github.com/spro/practical-pytorch/blob/master/seq2seq-translation/seq2seq-translation.ipynb" rel="nofollow noreferrer">https://github.com/spro/practical-pytorch/blob/master/seq2seq-translation/seq2seq-translation.ipynb</a> from PyTorch tutorials. </p>
  
  <p>The next thing I am trying to do is train my model with fixed embedding.
  I have an array of embeddings (length 16) for every word in the training set. For example:</p>
  
  <pre><code>looks   0.007668 -0.011884 -0.009672 0.011174 0.030010 0.023078 -0.028925 -0.003394 -0.028641 0.010982 -0.021261 0.009686 0.020191 -0.004228 -0.009142 -0.022826
  like    0.007500 0.024508 -0.019484 -0.003581 0.007626 0.012839 0.003500 0.023110 0.008789 0.020518 -0.020819 -0.012393 0.011967 0.028991 0.010099 0.004167
  that    0.004982 0.007892 0.020845 0.025090 -0.015644 -0.015740 -0.010126 -0.016822 0.007736 -0.023931 -0.014181 -0.031085 0.013599 0.027267 -0.013781 -0.028441
  </code></pre>
  
  <p>etc.</p>
  
  <p>I used the <code>from_pretrained</code> method in order to provide my own embeddings. I changed the Encoder as: </p>
  
  <pre><code>class EncoderRNN(nn.Module):
      def __init__(self, input_size, hidden_size):
          super(EncoderRNN, self).__init__()
          self.hidden_size = hidden_size
  
          #self.embedding = nn.Embedding(input_size, hidden_size)
          embedds = np.load('embedds.dat')
          embedds = torch.from_numpy(embedds)
          embedds = embedds.type(torch.FloatTensor)     #x = x.type(torch.cuda.FloatTensor)
          self.embedding = nn.Embedding.from_pretrained(embedds)
  
  
          self.gru = nn.GRU(hidden_size, hidden_size)
  
      def forward(self, input, hidden):
          embedded = self.embedding(input).view(1, 1, -1)
          #print(embedded.size())
          #print(embedded)
          output = embedded
          output, hidden = self.gru(output, hidden)
          return output, hidden
  
      def initHidden(self):
          return torch.zeros(1, 1, self.hidden_size, device=device)
  </code></pre>
  
  <p>But when I train an error occurs:</p>
  
  <blockquote>
    <p>RuntimeError: index out of range at
    c:\programdata\miniconda3\conda-bld\pytorch_1533090623466\work\aten\src\th\generic/THTensorMath.cpp:352</p>
  </blockquote>
  
  <p>Can anyone provide any help on that?
  Thanks in advance</p>