MCPcopy Create free account
hub / github.com/XPixelGroup/DiffBIR / Upsample

Class Upsample

diffbir/model/vae.py:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24class Upsample(nn.Module):
25 def __init__(self, in_channels, with_conv):
26 super().__init__()
27 self.with_conv = with_conv
28 if self.with_conv:
29 self.conv = torch.nn.Conv2d(
30 in_channels, in_channels, kernel_size=3, stride=1, padding=1
31 )
32
33 def forward(self, x):
34 x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
35 if self.with_conv:
36 x = self.conv(x)
37 return x
38
39
40class Downsample(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected