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

Class Downsample3D

diffsynth/models/stepvideo_vae.py:544–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542
543
544class Downsample3D(nn.Module):
545 def __init__(self,
546 in_channels,
547 with_conv,
548 stride
549 ):
550 super().__init__()
551
552 self.with_conv = with_conv
553 if with_conv:
554 self.conv = CausalConv(in_channels, in_channels, kernel_size=3, stride=stride)
555
556 def forward(self, x, is_init=True):
557 if self.with_conv:
558 x = self.conv(x, is_init)
559 else:
560 x = nn.functional.avg_pool3d(x, kernel_size=2, stride=2)
561 return x
562
563class VideoEncoder(nn.Module):
564 def __init__(self,

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected