MCPcopy Create free account
hub / github.com/AlayaLab/Hive / Upsample

Class Upsample

models/flowsep/latent_diffusion/modules/diffusionmodules/model.py:44–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43
44class Upsample(nn.Module):
45 def __init__(self, in_channels, with_conv):
46 super().__init__()
47 self.with_conv = with_conv
48 if self.with_conv:
49 self.conv = torch.nn.Conv2d(
50 in_channels, in_channels, kernel_size=3, stride=1, padding=1
51 )
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 UpsampleTimeStride4(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