MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / Upsample

Class Upsample

code/dc_ldm/modules/diffusionmodules/model.py:42–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41
42class Upsample(nn.Module):
43 def __init__(self, in_channels, with_conv):
44 super().__init__()
45 self.with_conv = with_conv
46 if self.with_conv:
47 self.conv = torch.nn.Conv2d(in_channels,
48 in_channels,
49 kernel_size=3,
50 stride=1,
51 padding=1)
52
53 def forward(self, x):
54 x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
55 if self.with_conv:
56 x = self.conv(x)
57 return x
58
59
60class Downsample(nn.Module):

Callers 4

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected