(self, x, temb=None)
| 150 | padding=0) |
| 151 | |
| 152 | def forward(self, x, temb=None): |
| 153 | h = x |
| 154 | h = self.norm1(h) |
| 155 | h = nonlinearity(h) |
| 156 | h = self.conv1(h) |
| 157 | |
| 158 | if temb is not None: |
| 159 | h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None] |
| 160 | |
| 161 | h = self.norm2(h) |
| 162 | h = nonlinearity(h) |
| 163 | h = self.dropout(h) |
| 164 | h = self.conv2(h) |
| 165 | |
| 166 | if self.in_channels != self.out_channels: |
| 167 | if self.use_conv_shortcut: |
| 168 | x = self.conv_shortcut(x) |
| 169 | else: |
| 170 | x = self.nin_shortcut(x) |
| 171 | |
| 172 | return x+h |
| 173 | |
| 174 | |
| 175 | """ Attention """ |
nothing calls this directly
no test coverage detected