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

Method __init__

models/llama_7b.py:91–95  ·  view source on GitHub ↗
(self, dim: int, hidden_dim: int)

Source from the content-addressed store, hash-verified

89 """SwiGLU MLP (LLaMA-style)."""
90
91 def __init__(self, dim: int, hidden_dim: int):
92 super().__init__()
93 self.w1 = nn.Linear(dim, hidden_dim, bias=False) # gate
94 self.w2 = nn.Linear(hidden_dim, dim, bias=False) # down
95 self.w3 = nn.Linear(dim, hidden_dim, bias=False) # up
96
97 def forward(self, x: torch.Tensor) -> torch.Tensor:
98 return self.w2(F.silu(self.w1(x)) * self.w3(x))

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected