(self, x, temb=None, is_init=True)
| 525 | self.nin_shortcut = CausalConvAfterNorm(in_channels, out_channels, kernel_size=1) |
| 526 | |
| 527 | def forward(self, x, temb=None, is_init=True): |
| 528 | x = x.permute(0,2,3,4,1).contiguous() |
| 529 | |
| 530 | h = self.norm1(x, zero_pad=True, act_silu=True, pad_size=2) |
| 531 | h = self.conv1(h) |
| 532 | if temb is not None: |
| 533 | h = h + self.temb_proj(nn.functional.silu(temb))[:, :, None, None] |
| 534 | |
| 535 | x = self.nin_shortcut(x) if self.in_channels != self.out_channels else x |
| 536 | |
| 537 | h = self.norm2(h, zero_pad=True, act_silu=True, pad_size=2) |
| 538 | x = self.conv2(h, residual=x) |
| 539 | |
| 540 | x = x.permute(0,4,1,2,3) |
| 541 | return x |
| 542 | |
| 543 | |
| 544 | class Downsample3D(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected