MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / Upsample

Class Upsample

sat/sgm/modules/autoencoding/vqvae/vqvae_blocks.py:38–49  ·  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, in_channels, kernel_size=3, stride=1, padding=1)
44
45 def forward(self, x):
46 x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
47 if self.with_conv:
48 x = self.conv(x)
49 return x
50
51
52class Downsample(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected