MCPcopy Create free account
hub / github.com/MeiGen-AI/InfiniteTalk / forward

Method forward

wan/modules/model.py:337–347  ·  view source on GitHub ↗

r""" Args: x(Tensor): Shape [B, L1, C] e(Tensor): Shape [B, C]

(self, x, e)

Source from the content-addressed store, hash-verified

335 self.modulation = nn.Parameter(torch.randn(1, 2, dim) / dim**0.5)
336
337 def forward(self, x, e):
338 r"""
339 Args:
340 x(Tensor): Shape [B, L1, C]
341 e(Tensor): Shape [B, C]
342 """
343 assert e.dtype == torch.float32
344 with amp.autocast(dtype=torch.float32):
345 e = (self.modulation.to(e.device) + e.unsqueeze(1)).chunk(2, dim=1)
346 x = (self.head(self.norm(x) * (1 + e[1]) + e[0]))
347 return x
348
349
350class MLPProj(torch.nn.Module):

Callers 1

forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected