MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / __init__

Method __init__

models/bert_base.py:56–61  ·  view source on GitHub ↗
(self, hidden_size: int, num_heads: int, intermediate_size: int, dropout: float = 0.0)

Source from the content-addressed store, hash-verified

54
55class BertLayer(nn.Module):
56 def __init__(self, hidden_size: int, num_heads: int, intermediate_size: int, dropout: float = 0.0):
57 super().__init__()
58 self.attention = BertSelfAttention(hidden_size, num_heads, dropout)
59 self.norm1 = nn.LayerNorm(hidden_size)
60 self.mlp = BertMLP(hidden_size, intermediate_size, dropout)
61 self.norm2 = nn.LayerNorm(hidden_size)
62
63 def forward(self, x: torch.Tensor) -> torch.Tensor:
64 x = self.norm1(x + self.attention(x))

Callers

nothing calls this directly

Calls 3

BertSelfAttentionClass · 0.85
BertMLPClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected