If you are not using any of the more fancy options to Embedding, namely any of these padding_idx=None, max_norm=None, norm_type=2, scale_grad_by_freq=False, then your code looks plausibly correct to me.
That said, I am not particularly familiar with the inner workings of Embeddings, so I won’t give a clear definitive answer on that point.