I’ve tried the code snippet you’ve posted for

    def forward(self, batch, method='last_step', use_softmax=False):
        embeds = self.embedding(batch)
        x = torch.transpose(embeds, 0, 1)
        x, self.hidden = self.gru(x, self.hidden)

        if method == 'last_step':
            x = x[-1]
        elif method == 'average_pooling':
            x = torch.sum(x, dim=0) / len(batch[0])
        elif method == 'max_pooling':
            x, _ = torch.max(x, dim=0)
        else:
            raise Exception('Unknown method.')
        x = self.classifier(x)
        return (F.softmax(x,dim=1), self.hidden) if use_softmax else (x, self.hidden)

It looks like it’s predicting just a single label for each of the data point in the batch.
The expected in-/output should be e.g. the max length of the sequence is 5 and batch size is 3
x = [[1, 2 , 3 ,4], [5, 6, 7 ,0], [8, 9, 0, 0]] 

y = [[2 , 3 ,4, 0], [6, 7 ,0, 0], [9, 0, 0, 0]]