(self, x, temb)
| 157 | padding=0) |
| 158 | |
| 159 | def forward(self, x, temb): |
| 160 | h = x |
| 161 | h = self.norm1(h) |
| 162 | h = nonlinearity(h) |
| 163 | h = self.conv1(h) |
| 164 | |
| 165 | if temb is not None: |
| 166 | h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None] |
| 167 | |
| 168 | h = self.norm2(h) |
| 169 | h = nonlinearity(h) |
| 170 | h = self.dropout(h) |
| 171 | h = self.conv2(h) |
| 172 | |
| 173 | if self.in_channels != self.out_channels: |
| 174 | if self.use_conv_shortcut: |
| 175 | x = self.conv_shortcut(x) |
| 176 | else: |
| 177 | x = self.nin_shortcut(x) |
| 178 | |
| 179 | return x+h |
| 180 | |
| 181 | |
| 182 | class LinAttnBlock(LinearAttention): |
nothing calls this directly
no test coverage detected