(self, x, temb)
| 461 | padding=0) |
| 462 | |
| 463 | def forward(self, x, temb): |
| 464 | hidden_states = x |
| 465 | hidden_states = self.norm1(hidden_states) |
| 466 | hidden_states = self.nonlinearity(hidden_states) |
| 467 | hidden_states = self.conv1(hidden_states) |
| 468 | |
| 469 | if temb is not None: |
| 470 | temb = self.time_emb_proj(self.nonlinearity(temb)) |
| 471 | hidden_states = hidden_states + temb |
| 472 | |
| 473 | hidden_states = self.norm2(hidden_states) |
| 474 | hidden_states = self.nonlinearity(hidden_states) |
| 475 | hidden_states = self.conv2(hidden_states) |
| 476 | |
| 477 | if self.conv_shortcut is not None: |
| 478 | x = self.conv_shortcut(x) |
| 479 | |
| 480 | out = (x + hidden_states) |
| 481 | |
| 482 | return out |
| 483 | |
| 484 | |
| 485 | class Upsample2D(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected