You can use .view to first have sequence * batch in one dimension, apply the embedding and then .view it back to separate sequence x batch.
The language modelling tutorials should have examples.
Best regards
Thomas