I very much appreciate your answer @ptrblck
If i don’t collapse the sequence length into the batch dimension, i’m stuck with the tensor[21,10,10]
So, each batch contains 21 sentences, of 10 words (that are INTs) hence the [21,10];
If i avoid the “view” function, the output from forward will be a tensor of shape [21,10,10] and i get another error:

ValueError: Expected target size (21, 10), got torch.Size([21])

For a clear picture (Although the code is a frankenstein’s homage) here is the full code:
https://pastebin.com/WHnMU0k4 4
Cheers,
Sousa