MCPcopy Create free account
hub / github.com/ShihaoZhaoZSH/Uni-ControlNet / __init__

Method __init__

ldm/modules/diffusionmodules/model.py:656–676  ·  view source on GitHub ↗
(self, in_channels, out_channels, *args, **kwargs)

Source from the content-addressed store, hash-verified

654
655class SimpleDecoder(nn.Module):
656 def __init__(self, in_channels, out_channels, *args, **kwargs):
657 super().__init__()
658 self.model = nn.ModuleList([nn.Conv2d(in_channels, in_channels, 1),
659 ResnetBlock(in_channels=in_channels,
660 out_channels=2 * in_channels,
661 temb_channels=0, dropout=0.0),
662 ResnetBlock(in_channels=2 * in_channels,
663 out_channels=4 * in_channels,
664 temb_channels=0, dropout=0.0),
665 ResnetBlock(in_channels=4 * in_channels,
666 out_channels=2 * in_channels,
667 temb_channels=0, dropout=0.0),
668 nn.Conv2d(2*in_channels, in_channels, 1),
669 Upsample(in_channels, with_conv=True)])
670 # end
671 self.norm_out = Normalize(in_channels)
672 self.conv_out = torch.nn.Conv2d(in_channels,
673 out_channels,
674 kernel_size=3,
675 stride=1,
676 padding=1)
677
678 def forward(self, x):
679 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