def forward(self, sents_tensor, lengths):
    emb = self.embedding(sents_tensor)
    packed = pack_padded_sequence(emb, lengths, batch_first=True)
    (rnn_out, _) = self.bilstm(packed)
    (rnn_out, _) = pad_packed_sequence(rnn_out, batch_first=True)
    scores = self.lin(rnn_out)
    return scores
def forward(self, sents_tensor, lengths):
    emb = self.embedding(sents_tensor)
    packed = pack_padded_sequence(emb, lengths, batch_first=True)
    (rnn_out, _) = self.bilstm(packed)
    (rnn_out, _) = pad_packed_sequence(rnn_out, batch_first=True)
    scores = self.lin(rnn_out)
    return scores