(self, x: torch.Tensor)
| 540 | return imgs |
| 541 | |
| 542 | def patchify(self, x: torch.Tensor) -> torch.Tensor: |
| 543 | B, C, H, W = x.size() |
| 544 | assert (H, W) == (self.input_size, self.input_size) |
| 545 | pH = pW = self.patch_size |
| 546 | x = x.view(B, C, H // pH, pH, W // pW, pW) |
| 547 | x = x.permute(0, 2, 4, 1, 3, 5).flatten(-3).flatten(1, 2) |
| 548 | return x |
| 549 | |
| 550 | def forward(self, x, t, y): |
| 551 | """ |