MCPcopy Create free account
hub / github.com/CompVis/diff2flow / Upsample

Class Upsample

diff2flow/kl_autoencoder.py:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89class Upsample(nn.Module):
90 def __init__(self, in_channels, with_conv):
91 super().__init__()
92 self.with_conv = with_conv
93 if self.with_conv:
94 self.conv = nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1)
95
96 def forward(self, x):
97 x = nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
98 if self.with_conv:
99 x = self.conv(x)
100 return x
101
102
103class Downsample(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected