MCPcopy
hub / github.com/Wan-Video/Wan2.2 / forward

Method forward

wan/modules/t5.py:206–218  ·  view source on GitHub ↗
(self,
                x,
                mask=None,
                encoder_states=None,
                encoder_mask=None,
                pos_bias=None)

Source from the content-addressed store, hash-verified

204 num_buckets, num_heads, bidirectional=False)
205
206 def forward(self,
207 x,
208 mask=None,
209 encoder_states=None,
210 encoder_mask=None,
211 pos_bias=None):
212 e = pos_bias if self.shared_pos else self.pos_embedding(
213 x.size(1), x.size(1))
214 x = fp16_clamp(x + self.self_attn(self.norm1(x), mask=mask, pos_bias=e))
215 x = fp16_clamp(x + self.cross_attn(
216 self.norm2(x), context=encoder_states, mask=encoder_mask))
217 x = fp16_clamp(x + self.ffn(self.norm3(x)))
218 return x
219
220
221class T5RelativeEmbedding(nn.Module):

Callers

nothing calls this directly

Calls 2

fp16_clampFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected