(self, x)
| 103 | |
| 104 | |
| 105 | def forward(self, x): |
| 106 | h = self.conv_in(x) |
| 107 | # downsampling |
| 108 | for i_level, block in enumerate(self.conv_blocks): |
| 109 | for i_block in range(self.num_res_blocks): |
| 110 | h = block.res[i_block](h) |
| 111 | if len(block.attn) > 0: |
| 112 | h = block.attn[i_block](h) |
| 113 | if i_level != self.num_resolutions - 1: |
| 114 | h = block.downsample(h) |
| 115 | |
| 116 | # middle |
| 117 | for mid_block in self.mid: |
| 118 | h = mid_block(h) |
| 119 | |
| 120 | # end |
| 121 | h = self.norm_out(h) |
| 122 | h = nonlinearity(h) |
| 123 | h = self.conv_out(h) |
| 124 | return h |
| 125 | |
| 126 | |
| 127 |
nothing calls this directly
no test coverage detected