Understanding Embeddings input and output sizes
Both are correct.

Too clarify: when training in mini batches, it is more common to do padding after selecting eachmini batch. Say in your mini batch of size 16, if the longest sentence is of length 35, you want to pad this mini batch to 16x35x100.