According to the docs 4 Embedding layer returns a Tensor of the shape (N,W, embedding_dim) where N is the mini-batch size and W is number of indices to extract per mini-batch. After performing the view operation on that, you would get a tensor of the shape (1,1, N x W x embedding_dim). It is important to note that this is a 3 dimensional tensor. But since you are doing embedded[0].size(), you are essentially asking for the shape of the remaining two dimensions, which explains the result you are getting via the print statements. Hope this helps!