getting different model result from tokenizer vs tokenizer.encode function
# 🐛 Bug

I am using gpt2 model to encode sentences. I am confused between tokenizer.encode vs tokenizer : 

If I am using tokenizer.encode: 

```

sentence = 'checking single sentences'

from transformers import GPT2Tokenizer, GPT2Model
import torch

    
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
model     = GPT2Model.from_pretrained('gpt2-medium')
input_ids = torch.tensor(tokenizer.encode(sentence)).unsqueeze(0)  # Batch size 1
outputs   = model(input_ids)
outputs[0]
```

output is  : 

```
tensor([[[ 0.6804,  0.4182,  0.3483,  ..., -0.3102,  0.0341,  0.4901],
         [-0.4060,  0.7790,  0.2695,  ..., -0.4763,  0.1817,  0.0600],
         [ 0.7916,  0.6078,  0.4642,  ..., -0.5557, -0.1571, -0.1220]]],
       grad_fn=<ViewBackward>)
```

While using tokenizer alone : 

```
from transformers import GPT2Tokenizer, GPT2Model
sentence = 'checking single sentences'


tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
model     = GPT2Model.from_pretrained('gpt2-medium')
inputs    = tokenizer(sentence, return_tensors="pt")
outputs   = model(**inputs)
outputs[0]
```

output is : 

```
# tensor([[[ 0.5511,  0.4063,  0.2453,  ..., -0.4217,  0.1519,  0.0898],
#          [-0.1138, -0.0232,  0.1736,  ..., -0.5408,  0.0145,  0.2985],
#          [ 0.1856,  0.3127,  0.2430,  ..., -0.7532, -0.2332,  0.1506]]],
#        grad_fn=<ViewBackward>)
```

I tried to examine the output of both tokenizer : 

```
from transformers import GPT2Tokenizer, GPT2Model
import torch

sentence = 'checking single sentences'


tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
input_ids = tokenizer.encode(sentence)
inputs    = tokenizer(sentence, return_tensors="pt")

print(input_ids)

print(inputs)
```

output : 

```
[41004, 2060, 13439]
{'input_ids': tensor([[41004,  2060, 13439]]), 'token_type_ids': tensor([[0, 0, 0]]), 'attention_mask': tensor([[1, 1, 1]])}
```

Which is recommended tokenizer function? 
