| 1619 | ) |
| 1620 | class BertForMultipleChoice(BertPreTrainedModel): |
| 1621 | def __init__(self, config): |
| 1622 | super().__init__(config) |
| 1623 | |
| 1624 | self.bert = BertModel(config) |
| 1625 | classifier_dropout = ( |
| 1626 | config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob |
| 1627 | ) |
| 1628 | self.dropout = nn.Dropout(classifier_dropout) |
| 1629 | self.classifier = nn.Linear(config.hidden_size, 1) |
| 1630 | |
| 1631 | # Initialize weights and apply final processing |
| 1632 | self.post_init() |
| 1633 | |
| 1634 | @add_start_docstrings_to_model_forward(BERT_INPUTS_DOCSTRING.format("batch_size, num_choices, sequence_length")) |
| 1635 | @add_code_sample_docstrings( |