ptrblck:

This would depend on your use case. How did you create the embedding inputs, i.e. are the values depending on the data or did you create them in another way?


The values strongly depend on the data, in fact the function sentence2tok_tags(sentences) returns w that is a matrix word indexes padded, t that is a matrix of tag indexes padded and x_lengths that is an array with sentence lengths.
def sentence2tok_tags(self, sentences):
        w = [[e.norm for e in sentence] for sentence in sentences]
        w, x_lengths = self.prepare(w, self.word_vocab)
        t = [[e.get_partofspeech_tag(self.partofspeech_type) for e in sentence] for sentence in sentences]
        t, _ = self.prepare(t, self.tag_vocab)
        return w, t, x_lengths

where
def prepare(self, sentences, vocab):
        x = [torch.tensor([vocab[w] for w in sentence]).to(self.device) for sentence in sentences]
        x_lengths = np.array([len(sentence) for sentence in x])
        padded_x = torch.nn.utils.rnn.pad_sequence(x, batch_first=True)
        return padded_x, x_lengths