What the tokens are cross attentions output for?

I am trying to output the cross attentions from a T5 model generate() function. The output type is BeamSearchEncoderDecoderOutput. According to the document, the cross attention has Tuple (one element for each generated token). I check the output ids which have 35 tokens, including and . But there are only 34 cross attentions output. Which one was left out?

Thanks

Generation uses start_token_id as the prompt for the decoder to start generation. I believe that initial token is not a part of cross_attentions output.

1 Like