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

Method __init__

models/gpt2.py:58–63  ·  view source on GitHub ↗
(self, n_embd: int, dropout: float = 0.0)

Source from the content-addressed store, hash-verified

56
57class MLP(nn.Module):
58 def __init__(self, n_embd: int, dropout: float = 0.0):
59 super().__init__()
60 self.c_fc = nn.Linear(n_embd, 4 * n_embd)
61 self.gelu = nn.GELU()
62 self.c_proj = nn.Linear(4 * n_embd, n_embd)
63 self.dropout = nn.Dropout(dropout)
64
65 def forward(self, x: torch.Tensor) -> torch.Tensor:
66 x = self.c_fc(x)

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected