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

Method __init__

models/transformer/wan/modules/t5.py:180–204  ·  view source on GitHub ↗
(self,
                 dim,
                 dim_attn,
                 dim_ffn,
                 num_heads,
                 num_buckets,
                 shared_pos=True,
                 dropout=0.1)

Source from the content-addressed store, hash-verified

178class T5CrossAttention(nn.Module):
179
180 def __init__(self,
181 dim,
182 dim_attn,
183 dim_ffn,
184 num_heads,
185 num_buckets,
186 shared_pos=True,
187 dropout=0.1):
188 super(T5CrossAttention, self).__init__()
189 self.dim = dim
190 self.dim_attn = dim_attn
191 self.dim_ffn = dim_ffn
192 self.num_heads = num_heads
193 self.num_buckets = num_buckets
194 self.shared_pos = shared_pos
195
196 # layers
197 self.norm1 = T5LayerNorm(dim)
198 self.self_attn = T5Attention(dim, dim_attn, num_heads, dropout)
199 self.norm2 = T5LayerNorm(dim)
200 self.cross_attn = T5Attention(dim, dim_attn, num_heads, dropout)
201 self.norm3 = T5LayerNorm(dim)
202 self.ffn = T5FeedForward(dim, dim_ffn, dropout)
203 self.pos_embedding = None if shared_pos else T5RelativeEmbedding(
204 num_buckets, num_heads, bidirectional=False)
205
206 def forward(self,
207 x,

Callers

nothing calls this directly

Calls 5

T5LayerNormClass · 0.85
T5AttentionClass · 0.85
T5FeedForwardClass · 0.85
T5RelativeEmbeddingClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected