(
self,
hidden_states,
attention_mask=None,
head_mask=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
output_attentions=False,
)
| 303 | self.pruned_heads = self.pruned_heads.union(heads) |
| 304 | |
| 305 | def forward( |
| 306 | self, |
| 307 | hidden_states, |
| 308 | attention_mask=None, |
| 309 | head_mask=None, |
| 310 | encoder_hidden_states=None, |
| 311 | encoder_attention_mask=None, |
| 312 | output_attentions=False, |
| 313 | ): |
| 314 | self_outputs = self.self( |
| 315 | hidden_states, attention_mask, head_mask, encoder_hidden_states, encoder_attention_mask, output_attentions, |
| 316 | ) |
| 317 | attention_output = self.output(self_outputs[0], hidden_states) |
| 318 | outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them |
| 319 | return outputs |
| 320 | |
| 321 | |
| 322 | class BertIntermediate(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected