MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / __init__

Method __init__

code/dc_ldm/modules/diffusionmodules/model.py:572–592  ·  view source on GitHub ↗
(self, in_channels, out_channels, *args, **kwargs)

Source from the content-addressed store, hash-verified

570
571class SimpleDecoder(nn.Module):
572 def __init__(self, in_channels, out_channels, *args, **kwargs):
573 super().__init__()
574 self.model = nn.ModuleList([nn.Conv2d(in_channels, in_channels, 1),
575 ResnetBlock(in_channels=in_channels,
576 out_channels=2 * in_channels,
577 temb_channels=0, dropout=0.0),
578 ResnetBlock(in_channels=2 * in_channels,
579 out_channels=4 * in_channels,
580 temb_channels=0, dropout=0.0),
581 ResnetBlock(in_channels=4 * in_channels,
582 out_channels=2 * in_channels,
583 temb_channels=0, dropout=0.0),
584 nn.Conv2d(2*in_channels, in_channels, 1),
585 Upsample(in_channels, with_conv=True)])
586 # end
587 self.norm_out = Normalize(in_channels)
588 self.conv_out = torch.nn.Conv2d(in_channels,
589 out_channels,
590 kernel_size=3,
591 stride=1,
592 padding=1)
593
594 def forward(self, x):
595 for i, layer in enumerate(self.model):

Callers

nothing calls this directly

Calls 4

ResnetBlockClass · 0.85
UpsampleClass · 0.70
NormalizeFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected