I have a question regarding your explanation in the other post:
" With that it will predict the first token (token_1 ) of the output sequence, and the next thing we give to the decoder is: source = encoder_output and target = <BOS> token_1 .
It will output a second token,"
If input [BOS, token_1], the decoder will output also a sequence since every operation in the decoder cells maintains the shape. So how is the decoder output of the shape [batch, sequence, dim] converted into a single “second token” with the shape [batch, 1, dim], as you described? Is the sequence flattened and then the dimension adjusted with a linear layer, or do we simply take the last element of the decoder output as the new token?