(self, hidden_states, input_tensor)
| 497 | self.dropout = nn.Dropout(config.hidden_dropout_prob) |
| 498 | |
| 499 | def forward(self, hidden_states, input_tensor): |
| 500 | hidden_states = self.dense(hidden_states) |
| 501 | hidden_states = self.dropout(hidden_states) |
| 502 | ln_input = hidden_states + input_tensor |
| 503 | previous_type = ln_input.type() |
| 504 | if self.fp32_layernorm: |
| 505 | ln_input = ln_input.float() |
| 506 | hidden_states = self.LayerNorm(ln_input) |
| 507 | if self.fp32_layernorm: |
| 508 | hidden_states = hidden_states.type(previous_type) |
| 509 | return hidden_states |
| 510 | |
| 511 | |
| 512 | class BertLayer(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected