MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / __init__

Method __init__

wan/models/wan_image_encoder.py:98–106  ·  view source on GitHub ↗
(self, dim, mid_dim)

Source from the content-addressed store, hash-verified

96class SwiGLU(nn.Module):
97
98 def __init__(self, dim, mid_dim):
99 super().__init__()
100 self.dim = dim
101 self.mid_dim = mid_dim
102
103 # layers
104 self.fc1 = nn.Linear(dim, mid_dim)
105 self.fc2 = nn.Linear(dim, mid_dim)
106 self.fc3 = nn.Linear(mid_dim, dim)
107
108 def forward(self, x):
109 x = F.silu(self.fc1(x)) * self.fc2(x)

Callers 7

__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