MCPcopy Create free account
hub / github.com/THUDM/GLM / forward

Method forward

model/modeling_bert.py:499–509  ·  view source on GitHub ↗
(self, hidden_states, input_tensor)

Source from the content-addressed store, hash-verified

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
512class BertLayer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected