(self, x, temb)
| 119 | padding=0) |
| 120 | |
| 121 | def forward(self, x, temb): |
| 122 | h = x |
| 123 | h = self.norm1(h) |
| 124 | h = nonlinearity(h) |
| 125 | h = self.conv1(h) |
| 126 | |
| 127 | if temb is not None: |
| 128 | h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None] |
| 129 | |
| 130 | h = self.norm2(h) |
| 131 | h = nonlinearity(h) |
| 132 | h = self.dropout(h) |
| 133 | h = self.conv2(h) |
| 134 | |
| 135 | if self.in_channels != self.out_channels: |
| 136 | if self.use_conv_shortcut: |
| 137 | x = self.conv_shortcut(x) |
| 138 | else: |
| 139 | x = self.nin_shortcut(x) |
| 140 | |
| 141 | return x+h |
| 142 | |
| 143 | |
| 144 | class LinAttnBlock(LinearAttention): |
nothing calls this directly
no test coverage detected