Yes.
If I was in nitpicking mood, I would prefer to say “output” to not confuse it with the LSTM internal states ("_" aka (h,c)), and say you want output[0, 0] and an unsqueeze(1) on the ids to get the batch part right.
But I’m not, so:
Best regards
Thomas