MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / __init__

Method __init__

diffsynth/models/stepvideo_vae.py:161–176  ·  view source on GitHub ↗
(self,
                 channels,
                 use_conv=False,
                 use_conv_transpose=False,
                 out_channels=None)

Source from the content-addressed store, hash-verified

159
160class Upsample2D(nn.Module):
161 def __init__(self,
162 channels,
163 use_conv=False,
164 use_conv_transpose=False,
165 out_channels=None):
166 super().__init__()
167 self.channels = channels
168 self.out_channels = out_channels or channels
169 self.use_conv = use_conv
170 self.use_conv_transpose = use_conv_transpose
171
172 if use_conv:
173 self.conv = nn.Conv2d(self.channels, self.out_channels, 3, padding=1)
174 else:
175 assert "Not Supported"
176 self.conv = nn.ConvTranspose2d(channels, self.out_channels, 4, 2, 1)
177
178 def forward(self, x, output_size=None):
179 assert x.shape[-1] == self.channels

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected