MCPcopy Create free account
hub / github.com/CompVis/zigma / __init__

Method __init__

model_zigma.py:318–327  ·  view source on GitHub ↗
(self, hidden_size, patch_size, out_channels, cond=False)

Source from the content-addressed store, hash-verified

316 """
317
318 def __init__(self, hidden_size, patch_size, out_channels, cond=False):
319 super().__init__()
320 self.norm_final = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
321 self.linear = nn.Linear(
322 hidden_size, patch_size * patch_size * out_channels, bias=True
323 )
324 if cond:
325 self.adaLN_modulation = nn.Sequential(
326 nn.SiLU(), nn.Linear(hidden_size, 2 * hidden_size, bias=True)
327 )
328
329 def forward(self, x, c=None):
330 if c is not None:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected