(self, config)
| 906 | """ Compute SQuAD 2.0 answer class from classification and start tokens hidden states. """ |
| 907 | |
| 908 | def __init__(self, config): |
| 909 | super().__init__() |
| 910 | self.dense_0 = nn.Linear(config.hidden_size * 2, config.hidden_size) |
| 911 | self.activation = nn.Tanh() |
| 912 | self.dense_1 = nn.Linear(config.hidden_size, 1, bias=False) |
| 913 | |
| 914 | def forward(self, hidden_states, start_states=None, start_positions=None, cls_index=None): |
| 915 | """ |