(self, in_channels, out_channels, kernel_size, r=1)
| 174 | |
| 175 | class SPConvTranspose2d(nn.Module): |
| 176 | def __init__(self, in_channels, out_channels, kernel_size, r=1): |
| 177 | # upconvolution only along second dimension of image |
| 178 | # Upsampling using sub pixel layers |
| 179 | super(SPConvTranspose2d, self).__init__() |
| 180 | self.out_channels = out_channels |
| 181 | self.conv = nn.Conv2d(in_channels, out_channels * r, kernel_size=kernel_size, stride=(1, 1)) |
| 182 | self.r = r |
| 183 | |
| 184 | def forward(self, x): |
| 185 | out = self.conv(x) |