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

Method __init__

ldm/modules/diffusionmodules/model.py:841–854  ·  view source on GitHub ↗
(self, in_channels=None, learned=False, mode="bilinear")

Source from the content-addressed store, hash-verified

839
840class Resize(nn.Module):
841 def __init__(self, in_channels=None, learned=False, mode="bilinear"):
842 super().__init__()
843 self.with_conv = learned
844 self.mode = mode
845 if self.with_conv:
846 print(f"Note: {self.__class__.__name} uses learned downsampling and will ignore the fixed {mode} mode")
847 raise NotImplementedError()
848 assert in_channels is not None
849 # no asymmetric padding in torch conv, must do it ourselves
850 self.conv = torch.nn.Conv2d(in_channels,
851 in_channels,
852 kernel_size=4,
853 stride=2,
854 padding=1)
855
856 def forward(self, x, scale_factor=1.0):
857 if scale_factor==1.0:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected