MCPcopy Create free account
hub / github.com/dek924/PerX2CT / Upsample

Class Upsample

taming/modules/diffusionmodules/model.py:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

__init__Method · 0.70
__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