Added missing `test_tokenization_led`
Author: IMvision12
Pull request: yes

# What does this PR do?

Added missing `test_tokenization_led`, was similar to Bart tokenizer made some changes by testing it in local environment
@sgugger 


Comments:
_The documentation is not available anymore as the PR was closed or merged._

@ydshieh Can you give some more points of what exactly is to be done?

As per the points given by you, I need to first create 2 texts let's say `A long paragraph for summarization.` and `Another paragraph for`, and then encode them as `tokenizer.encode_plus("Another paragraph for", padding=False)` passing padding as False so that it doesn't apply padding to text, and then we have to create a list of `global_attention_mask` let's say [0,0,0,0,0], doing this for both the text and then pass encoded_inputs along with `global_attention_mask` to the `tokenizer._pad()`

@IMvision12 Yes, that's the idea :-). Only at the end, you can do `tokenizer.pad()` instead -> it will call `_pad` internally.

@ydshieh Also what I really need to check in `assertEqual`?

We need to check the outputs after padding contains the key `global_attention_mask` and its value is the same as the expected one, which is the `global_attention_mask` being padded. You will either have to take a quick look in ` _pad`  or at least run one example to get a better idea (which should be easy enough) what it does :-)

@ydshieh can you take a quick look at this function
Is this expected to be done?

```
    def test_global_attention(self):
        text = ["A long paragraph for summarization.", "Another paragraph for summarization."]
        tokenizer = self.default_tokenizer_fast()
        
        input_1 = tokenizer.encode_plus(text[0], padding=False)
        input_1['global_attention_mask'] = [0,0,0,0,0]
        outputs_1 = tokenizer.pad(input_1)
        self.assertEqual(outputs_1['global_attention_mask'],[0, 0, 0, 0, 0, -1, -1, -1, -1])

        input_2 = tokenizer.encode_plus(text[1], padding=False)
        input_2['global_attention_mask'] = [0,0,0,0]
        outputs_2 = tokenizer.pad(input_2)
        self.assertEqual(outputs_2['global_attention_mask'],[0, 0, 0, 0, -1])

```

@IMvision12 

The idea is to encode the 2 texts together without padding, and send the encoded outputs with `global_attention_mask` (not padded neither) to `.pad`.

You code above pads each sequence, which won't have any padding. The padding only happens with multiple sequences where the length are different.

@ydshieh sorry for pinging you so many times
Also i have created this colab for understanding https://colab.research.google.com/drive/1jYwtsE41ouAeh5aNzfWZ2LNLizFOwvQr?usp=sharing
```
def test_global_attention_mask(self):
        text = ["A long paragraph.", "Hi I am using huggingface transformers"]
        tokenizer = self.default_tokenizer_fast()
        
        inputs = tokenizer.encode_plus(text, padding=False)
        inputs['global_attention_mask'] = [0,0,0,0,0,0,0,0]
        outputs = tokenizer.pad(inputs)
        self.assertEqual(outputs['global_attention_mask'],[0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1])
```

Hi, hope the following explains it more clearly :-)


First, batch encoding
```python
text = ["A long paragraph.", "Hi I am using huggingface transformers"]
x = tokenizer(text, padding=False)
x
```

Add `global_attention_mask` that is not padded
```python
x['global_attention_mask'] = [[0] * len(y) for y in x["input_ids"]]
x
```

Pad the whole un-padded inputs
```
tokenizer.pad(x)
```

I am not sure why `tests_pipelines_tf` are failing

No need to worry about the TF pipeline test. I will take a look - it's probably irrelevant to this PR.

Could you update your local main branch , and rebase your working branch on local `main`?

@ydshieh Done! any more changes?

@ydshieh Thanks for a concise explanation of `global_attention_mask` and guidance!!