(self, config)
| 240 | |
| 241 | class BertPredictionHeadTransform(nn.Module): |
| 242 | def __init__(self, config): |
| 243 | super().__init__() |
| 244 | self.dense = nn.Linear(config.hidden_size, config.hidden_size) |
| 245 | if isinstance(config.hidden_act, str): |
| 246 | self.transform_act_fn = get_act_fn(config.head_pred_act) |
| 247 | else: |
| 248 | self.transform_act_fn = config.hidden_act |
| 249 | self.LayerNorm = get_norm_layer(config) |
| 250 | |
| 251 | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: |
| 252 | hidden_states = self.dense(hidden_states) |
nothing calls this directly
no test coverage detected