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

Method __init__

codegeex/torch/codegeex_model.py:21–39  ·  view source on GitHub ↗
(
        self, 
        hidden_size,
    )

Source from the content-addressed store, hash-verified

19 """
20
21 def __init__(
22 self,
23 hidden_size,
24 ):
25 super(MLP, self).__init__()
26 self.hidden_size = hidden_size
27 # Project to 4h.
28 self.dense_h_to_4h = torch.nn.Linear(
29 self.hidden_size,
30 4 * self.hidden_size,
31 )
32
33 self.activation_func = fast_gelu
34
35 # Project back to h.
36 self.dense_4h_to_h = torch.nn.Linear(
37 4 * self.hidden_size,
38 self.hidden_size,
39 )
40
41 def forward(self, hidden_states):
42 # [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