Is it necessary to provide attention_mask, or model will calculate itself?
Is it necessary to provide attention_mask, or model will calculate itself?
If you do not pass an `attention_mask` then the `attention_mask` will automatically set to all ones (`[1, 1, 1, ...,]`). Meanning that every token is attended to (no token is masked). Also check out the docs here: https://huggingface.co/transformers/glossary.html#attention-mask.

If your `input_ids` contain <PAD> tokens, then the `attention_mask` will not automatically be calculated. You can leverage the tokenizers though to automatically retrieve the correct `attention_mask`.