MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / __init__

Method __init__

models/wan/model.py:317–330  ·  view source on GitHub ↗
(self, dim, out_dim, patch_size, eps=1e-6)

Source from the content-addressed store, hash-verified

315class Head(nn.Module):
316
317 def __init__(self, dim, out_dim, patch_size, eps=1e-6):
318 super().__init__()
319 self.dim = dim
320 self.out_dim = out_dim
321 self.patch_size = patch_size
322 self.eps = eps
323
324 # layers
325 out_dim = math.prod(patch_size) * out_dim
326 self.norm = WanLayerNorm(dim, eps)
327 self.head = nn.Linear(dim, out_dim)
328
329 # modulation
330 self.modulation = nn.Parameter(torch.randn(1, 2, dim) / dim**0.5)
331
332 def forward(self, x, e):
333 r"""

Callers 7

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

WanLayerNormClass · 0.85

Tested by

no test coverage detected