MCPcopy Create free account
hub / github.com/IceClear/StableSR / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

836
837class SimpleDecoder(nn.Module):
838 def __init__(self, in_channels, out_channels, *args, **kwargs):
839 super().__init__()
840 self.model = nn.ModuleList([nn.Conv2d(in_channels, in_channels, 1),
841 ResnetBlock(in_channels=in_channels,
842 out_channels=2 * in_channels,
843 temb_channels=0, dropout=0.0),
844 ResnetBlock(in_channels=2 * in_channels,
845 out_channels=4 * in_channels,
846 temb_channels=0, dropout=0.0),
847 ResnetBlock(in_channels=4 * in_channels,
848 out_channels=2 * in_channels,
849 temb_channels=0, dropout=0.0),
850 nn.Conv2d(2*in_channels, in_channels, 1),
851 Upsample(in_channels, with_conv=True)])
852 # end
853 self.norm_out = Normalize(in_channels)
854 self.conv_out = torch.nn.Conv2d(in_channels,
855 out_channels,
856 kernel_size=3,
857 stride=1,
858 padding=1)
859
860 def forward(self, x):
861 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