Hi
I am a new to deep learning.
I am testing this model.When I run this code, Index is supported to be a vector run time error comes out.
class BiLSTM(nn.Module):
def init(self,embedding_dim,hidden_dim,vocab_size,tagset_size):
super(BiLSTM, self).init()
self.embedding_dim = embedding_dim
self.hidden_dim = hidden_dim
self.vocab_size = vocab_size
self.tag_to_ix = tag_to_ix
self.tagset_size = len(tag_to_ix)
self.dropout = nn.Dropout(0.2)
    self.word_embeds = nn.Embedding(vocab_size, embedding_dim)
    self.lstm = nn.LSTM(embedding_dim, hidden_dim // 2,
                        num_layers=1, bidirectional=True)

    self.hidden2tag = nn.Linear(hidden_dim, self.tagset_size)
    self.hidden = self.init_hidden()

def init_hidden(self):
    return (autograd.Variable(torch.randn(2, 1, self.hidden_dim // 2)),
            autograd.Variable(torch.randn(2, 1, self.hidden_dim // 2)))

def forward(self, sentence):
    self.hidden = self.init_hidden()
    embeds = self.word_embeds(sentence)
    lstm_out, self.hidden = self.lstm(embeds.view(len(sentence), 1, -1), self.hidden)
    #embeds = self.word_embeds(sentence).view(len(sentence), 1, -1)
    #lstm_in=self.dropout(embeds)
    #lstm_out, self.hidden = self.lstm(lstm_in, self.hidden)
    #lstm_out = lstm_out.view(len(sentence), self.hidden_dim)
    lstm_out=self.dropout(lstm_out)
    tag_space = self.hidden2tag(lstm_out)
    tag_score=F.log_softmax(tag_space)
    return tag_score