Looks like your input batch size is 10 (from a), which happens to equal your vocabulary size in x.
Your code looks fine if the above assumption is right.
Just to remind that if your input contains multiple input, say
a = torch.LongTensor([[0,1,2],[0,4,6]])
this means you’ve got a batch of size 2 and each sample has 3 features.
Then after embedding, you’ll get tensor of size (2, 3, 100),
From my point of view, a reshape(-1, 3*100) or view(-1, 3*100) is needed in order to apply BatchNorm1d
Pls correct me if Im wrong.