w = torch.rand(10000, 256)
x = torch.tensor([0, 1, 2])

y1 = F.embedding(x, w)
y2 = w[x]

print((y1-y2).abs().sum().item())
# Out: 0

it seems like F.embedding and numpy style indexing can be used interchangeably, but F.embedding is about 20% faster. is there any other differences between these two methods? for example their behavior during backward pass