(self, x)
| 108 | self.conv = conv_nd(dims, self.channels, self.out_channels, 3, padding=padding) |
| 109 | |
| 110 | def forward(self, x): |
| 111 | assert x.shape[1] == self.channels |
| 112 | if self.dims == 3: |
| 113 | x = F.interpolate( |
| 114 | x, (x.shape[2], x.shape[3] * 2, x.shape[4] * 2), mode="nearest" |
| 115 | ) |
| 116 | else: |
| 117 | x = F.interpolate(x, scale_factor=2, mode="nearest") |
| 118 | if self.use_conv: |
| 119 | x = self.conv(x) |
| 120 | return x |
| 121 | |
| 122 | class TransposedUpsample(nn.Module): |
| 123 | 'Learned 2x upsampling without padding' |
nothing calls this directly
no outgoing calls
no test coverage detected