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

Class Upsample

sat/sgm/modules/diffusionmodules/model.py:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53class Upsample(nn.Module):
54 def __init__(self, in_channels, with_conv):
55 super().__init__()
56 self.with_conv = with_conv
57 if self.with_conv:
58 self.conv = torch.nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1)
59
60 def forward(self, x):
61 x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
62 if self.with_conv:
63 x = self.conv(x)
64 return x
65
66
67class Downsample(nn.Module):

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected