Method
__init__
(self, in_channels, with_conv)
Source from the content-addressed store, hash-verified
| 54 | |
| 55 | class Downsample(nn.Module): |
| 56 | def __init__(self, in_channels, with_conv): |
| 57 | super().__init__() |
| 58 | self.with_conv = with_conv |
| 59 | if self.with_conv: |
| 60 | # no asymmetric padding in torch conv, must do it ourselves |
| 61 | self.conv = torch.nn.Conv2d(in_channels, |
| 62 | in_channels, |
| 63 | kernel_size=3, |
| 64 | stride=2, |
| 65 | padding=0) |
| 66 | |
| 67 | def forward(self, x): |
| 68 | if self.with_conv: |
Callers
nothing calls this directly
Tested by
no test coverage detected