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

Method __init__

wan/models/wan_text_encoder.py:114–123  ·  view source on GitHub ↗
(self, dim, dim_ffn, dropout=0.1)

Source from the content-addressed store, hash-verified

112class T5FeedForward(nn.Module):
113
114 def __init__(self, dim, dim_ffn, dropout=0.1):
115 super(T5FeedForward, self).__init__()
116 self.dim = dim
117 self.dim_ffn = dim_ffn
118
119 # layers
120 self.gate = nn.Sequential(nn.Linear(dim, dim_ffn, bias=False), GELU())
121 self.fc1 = nn.Linear(dim, dim_ffn, bias=False)
122 self.fc2 = nn.Linear(dim_ffn, dim, bias=False)
123 self.dropout = nn.Dropout(dropout)
124
125 def forward(self, x):
126 x = self.fc1(x) * self.gate(x)

Callers

nothing calls this directly

Calls 2

GELUClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected