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

Method __init__

src/bert_layers/layers.py:675–678  ·  view source on GitHub ↗
(self, config: FlexBertConfig)

Source from the content-addressed store, hash-verified

673 """
674
675 def __init__(self, config: FlexBertConfig):
676 super().__init__()
677 self.layers = nn.ModuleList([get_bert_layer(config, layer_id=i) for i in range(config.num_hidden_layers)])
678 self.num_attention_heads = config.num_attention_heads
679
680 def forward(self, hidden_states: torch.Tensor, attention_mask: torch.Tensor, **kwargs) -> torch.Tensor:
681 for layer_module in self.layers:

Callers

nothing calls this directly

Calls 2

get_bert_layerFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected