MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / __init__

Method __init__

models/transformer/wan/modules/t5.py:125–134  ·  view source on GitHub ↗
(self, dim, dim_ffn, dropout=0.1)

Source from the content-addressed store, hash-verified

123class T5FeedForward(nn.Module):
124
125 def __init__(self, dim, dim_ffn, dropout=0.1):
126 super(T5FeedForward, self).__init__()
127 self.dim = dim
128 self.dim_ffn = dim_ffn
129
130 # layers
131 self.gate = nn.Sequential(nn.Linear(dim, dim_ffn, bias=False), GELU())
132 self.fc1 = nn.Linear(dim, dim_ffn, bias=False)
133 self.fc2 = nn.Linear(dim_ffn, dim, bias=False)
134 self.dropout = nn.Dropout(dropout)
135
136 def forward(self, x):
137 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