Method
__init__
(self, in_channels, with_conv)
Source from the content-addressed store, hash-verified
| 41 | |
| 42 | class Upsample(nn.Module): |
| 43 | def __init__(self, in_channels, with_conv): |
| 44 | super().__init__() |
| 45 | self.with_conv = with_conv |
| 46 | if self.with_conv: |
| 47 | self.conv = torch.nn.Conv2d(in_channels, |
| 48 | in_channels, |
| 49 | kernel_size=3, |
| 50 | stride=1, |
| 51 | padding=1) |
| 52 | |
| 53 | def forward(self, x): |
| 54 | x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest") |
Callers
nothing calls this directly
Tested by
no test coverage detected