MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / __init__

Method __init__

src/bert_layers/layers.py:242–249  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

240
241class 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)

Callers

nothing calls this directly

Calls 3

get_act_fnFunction · 0.85
get_norm_layerFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected