(self, x)
| 189 | self.conv_out = nn.Conv2d(block_in, z_channels, kernel_size=3, stride=1, padding=1) |
| 190 | |
| 191 | def forward(self, x): |
| 192 | h = self.conv_in(x) |
| 193 | for i_level, block in enumerate(self.conv_blocks): |
| 194 | for i_block in range(self.num_res_blocks): |
| 195 | h = block.res[i_block](h) |
| 196 | if len(block.attn) > 0: |
| 197 | h = block.attn[i_block](h) |
| 198 | if i_level != self.num_resolutions - 1: |
| 199 | h = block.downsample(h) |
| 200 | for mid_block in self.mid: |
| 201 | h = mid_block(h) |
| 202 | h = self.norm_out(h) |
| 203 | h = nonlinearity(h) |
| 204 | h = self.conv_out(h) |
| 205 | return h |
| 206 | |
| 207 | class Decoder(nn.Module): |
| 208 | def __init__(self, z_channels=256, ch=128, ch_mult=(1,1,2,2,4), num_res_blocks=2, norm_type="group", |
nothing calls this directly
no test coverage detected