You don’t need the attention mask for that explicitly, as you can create it yourself. You just need the input token IDs. Then you can get the index where input_tokens_ids == tokenizer.pad_token_id, and then you can select those indices from the output. If you cannot figure out to do this I can post a snippet here.