I’m unsure what “embedding size” means in this context, but the input to nn.Embedding has to be in the range [0, num_embeddings-1] while embedding_dim can be chosen to a desired value and will be used as the feature vector dimension for each dense output tensor.
Here is a small code snippet showing the issue:
num_embeddings = 100
embedding_dim = 10
emb = nn.Embedding(num_embeddings=num_embeddings, embedding_dim=embedding_dim)
x = torch.randint(0, num_embeddings, (64, 1))

print(x.min(), x.max())
# > tensor(1) tensor(99)

out = emb(x) # works since x is in [0, num_embeddings-1]

x[0] = 100
out = emb(x)
# > IndexError: index out of range in self
# fails because x is out of range