MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / __init__

Method __init__

codegeex/oneflow/codegeex_model.py:22–40  ·  view source on GitHub ↗
(
        self, 
        hidden_size,
    )

Source from the content-addressed store, hash-verified

20 """
21
22 def __init__(
23 self,
24 hidden_size,
25 ):
26 super(MLP, self).__init__()
27 self.hidden_size = hidden_size
28 # Project to 4h.
29 self.dense_h_to_4h = torch.nn.Linear(
30 self.hidden_size,
31 4 * self.hidden_size,
32 )
33
34 self.activation_func = fast_gelu
35
36 # Project back to h.
37 self.dense_4h_to_h = torch.nn.Linear(
38 4 * self.hidden_size,
39 self.hidden_size,
40 )
41
42 def forward(self, hidden_states):
43 # [s, b, 4hp]

Callers 9

__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
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected