Hi Richard,
Thanks for reply.
I have checked the size of batch produced by dataloader, I think no problem there.
When batch_size == 1, dataloader will produce data as [LongTensor([x1]), LongTensor([y1])]. For batch_size > 1, for example batch_size == 2 produced batch is [LongTensor([x1,x2]), LongTensor([y1, y2])].
And also I have checked the size of vectors after embedding lookup.
Because the code can run on older PyTorch, I am wondering if it is a bug?