MCPcopy Create free account
hub / github.com/dek924/PerX2CT / __init__

Method __init__

taming/modules/diffusionmodules/model.py:702–722  ·  view source on GitHub ↗
(self, in_channels, out_channels, *args, **kwargs)

Source from the content-addressed store, hash-verified

700
701class SimpleDecoder(nn.Module):
702 def __init__(self, in_channels, out_channels, *args, **kwargs):
703 super().__init__()
704 self.model = nn.ModuleList([nn.Conv2d(in_channels, in_channels, 1),
705 ResnetBlock(in_channels=in_channels,
706 out_channels=2 * in_channels,
707 temb_channels=0, dropout=0.0),
708 ResnetBlock(in_channels=2 * in_channels,
709 out_channels=4 * in_channels,
710 temb_channels=0, dropout=0.0),
711 ResnetBlock(in_channels=4 * in_channels,
712 out_channels=2 * in_channels,
713 temb_channels=0, dropout=0.0),
714 nn.Conv2d(2*in_channels, in_channels, 1),
715 Upsample(in_channels, with_conv=True)])
716 # end
717 self.norm_out = Normalize(in_channels)
718 self.conv_out = torch.nn.Conv2d(in_channels,
719 out_channels,
720 kernel_size=3,
721 stride=1,
722 padding=1)
723
724 def forward(self, x):
725 for i, layer in enumerate(self.model):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected