MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

tests/unit/runtime/zero/test_zero_leaf_module.py:99–104  ·  view source on GitHub ↗
(self, hidden_dim)

Source from the content-addressed store, hash-verified

97class MLPBlock(nn.Module):
98
99 def __init__(self, hidden_dim):
100 super(MLPBlock, self).__init__()
101 self.gate_proj = nn.Linear(hidden_dim, hidden_dim, bias=False)
102 self.up_proj = nn.Linear(hidden_dim, hidden_dim, bias=False)
103 self.down_proj = nn.Linear(hidden_dim, hidden_dim, bias=False)
104 self.act_fn = nn.GELU()
105
106 def forward(self, x):
107 return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))

Callers 8

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected