BERT uncased model outputs a tuple instead of a normal pytorch tensor 
While finetuning the BERT uncased model for sequence classification as follows:

```
config = BertConfig.from_pretrained('bert-base-uncased')
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertForSequenceClassification(config)

for layer, child in model.named_children():
    if layer not in ['classifier']:
        for param in child.parameters():
            param.requires_grad = False

optimizer = optim.SGD(model.parameters(), lr=1e-3)
criterion = nn.CrossEntropyLoss()

for (data, target) in (train_loader):
    data, target = data.to(device), target.to(device)   
    
    optimizer.zero_grad()
    output = model(data)
    target = target.float()
    loss = criterion(output, target)
    loss.backward()
    optimizer.step()

```
The following error comes up :
```
   1348         dim = _get_softmax_dim('log_softmax', input.dim(), _stacklevel)
   1349     if dtype is None:
-> 1350         ret = input.log_softmax(dim)
   1351     else:
   1352         ret = input.log_softmax(dim, dtype=dtype)

AttributeError: 'tuple' object has no attribute 'log_softmax'
```
Here are the model output and target tensors : 
```
--> output
(tensor([[-0.2530,  0.0788],
         [-0.1457, -0.0624],
         [-0.3478, -0.2125],
         [-0.1337,  0.2051],
         [ 0.0963,  0.3762],
         [-0.0910, -0.0527],
         [-0.1743,  0.2566],
         [-0.2223,  0.4083],
         [-0.1602, -0.0012],
         [-0.0059,  0.2334],
         [-0.3407, -0.1703],
         [-0.1359,  0.0776],
         [-0.2117,  0.1641],
         [-0.3365, -0.1266],
         [-0.1682,  0.0504],
         [-0.2346,  0.2380]], device='cuda:0', grad_fn=<AddmmBackward>),)

--> target

tensor([0., 0., 1., 1., 1., 0., 0., 0., 1., 1., 1., 0., 0., 0., 1., 0.],
       device='cuda:0')
```
Hi, I was wondering how you managed to resolve this issue? I'm running into a similar problem. :) <|||||>Hi, the model outputs are well documented, they're *always* tuples, even if there's a single return value. You can check the documentation [here](https://huggingface.co/transformers/main_classes/output.html).<|||||>@jacqueline-he  did you resolve the issue?<|||||>@WeeHyongTok Yes I have! I only needed to access what's inside the returned tuple. @LysandreJik's recommendation was very helpful. 