I think when you do
embedding = nn.Embedding(num_embeddings=10, embedding_dim=3)

then it means that you have 10 words and represent each of those words by an embedding of size 3, for example, if you have words like
hello

world

and so on, then each of these would be represented by 3 numbers,
one example would be,
hello -> [0.01 0.2 0.5]
world -> [0.04 0.6 0.7]

and so on, if you do
list(embedding.parameters())

then you will get something like this,
[Parameter containing:
 tensor([[ 0.9227,  0.6492, -1.1440],
         [ 1.5318, -0.2873, -0.7290],
         [-0.4234, -1.7012, -0.9684],
         [-0.2859,  1.4677, -1.4499],
         [-1.8966, -1.4591,  0.5218],
         [ 2.4023, -1.5395, -0.7947],
         [-0.0464,  0.7174, -0.7452],
         [ 0.9500, -0.4633,  0.5398],
         [ 0.3458, -0.7997,  0.8895],
         [-0.3303, -0.5663, -0.2300]], requires_grad=True)]

which represents how are each of these words represented,
when you do,
a = torch.LongTensor([[1, 2, 3, 4], [4, 3, 2, 1]]) # (2, 4)

and then
embedding(a).shape

it gives
torch.Size([2, 4, 3])

while
embedding(a)

gives
tensor([[[ 1.5318, -0.2873, -0.7290],
         [-0.4234, -1.7012, -0.9684],
         [-0.2859,  1.4677, -1.4499],
         [-1.8966, -1.4591,  0.5218]],

        [[-1.8966, -1.4591,  0.5218],
         [-0.2859,  1.4677, -1.4499],
         [-0.4234, -1.7012, -0.9684],
         [ 1.5318, -0.2873, -0.7290]]], grad_fn=<EmbeddingBackward>)

because you are retrieving the embeddings of those words, means, you are asking give me the embedding of word at index 1, give me embedding of word at index 2, and so on. So, it gives you embeddings of words at indices that you asked.
when you do
b = torch.LongTensor([[1, 2, 3], [2, 3, 1], [4, 5, 6], [3, 3, 3], [2, 1, 2],
                      [6, 7, 8], [2, 5, 2], [3, 5, 8], [2, 3, 6], [8, 9, 6],
                      [2, 6, 3], [6, 5, 4], [2, 6, 5]]) # (13, 3)
embedding(b)

then it means gives me the embedding of word at index 1, give me embedding of word at index 2, then 3, then 2, then 3, then 1 and so on.
here, ‘a’ and ‘b’ contain indices of words you want to retrieve the embedding for.