MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

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