(self, in_channels, with_conv)
| 91 | |
| 92 | class Downsample(nn.Module): |
| 93 | def __init__(self, in_channels, with_conv): |
| 94 | super().__init__() |
| 95 | self.with_conv = with_conv |
| 96 | if self.with_conv: |
| 97 | # no asymmetric padding in torch conv, must do it ourselves |
| 98 | self.conv = torch.nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=2, padding=0) |
| 99 | |
| 100 | def forward(self, x): |
| 101 | if self.with_conv: |