(self, config)
| 574 | |
| 575 | class BertPooler(nn.Module): |
| 576 | def __init__(self, config): |
| 577 | super(BertPooler, self).__init__() |
| 578 | self.dense = nn.Linear(config.hidden_size, config.hidden_size) |
| 579 | self.activation = nn.Tanh() |
| 580 | |
| 581 | def forward(self, hidden_states): |
| 582 | # We "pool" the model by simply taking the hidden state corresponding |