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

Method __init__

diffsynth/models/stepvideo_vae.py:199–211  ·  view source on GitHub ↗
(self, channels, use_conv=False, out_channels=None, padding=1)

Source from the content-addressed store, hash-verified

197
198class Downsample2D(nn.Module):
199 def __init__(self, channels, use_conv=False, out_channels=None, padding=1):
200 super().__init__()
201 self.channels = channels
202 self.out_channels = out_channels or channels
203 self.use_conv = use_conv
204 self.padding = padding
205 stride = 2
206
207 if use_conv:
208 self.conv = nn.Conv2d(self.channels, self.out_channels, 3, stride=stride, padding=padding)
209 else:
210 assert self.channels == self.out_channels
211 self.conv = nn.AvgPool2d(kernel_size=stride, stride=stride)
212
213 def forward(self, x):
214 assert x.shape[-1] == self.channels

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected