(self, x: torch.Tensor)
| 578 | self._cross_kv_initialized = True |
| 579 | |
| 580 | def patchify(self, x: torch.Tensor): |
| 581 | x = self.patch_embedding(x) |
| 582 | grid_size = x.shape[2:] |
| 583 | x = rearrange(x, 'b c f h w -> b (f h w) c').contiguous() |
| 584 | return x, grid_size # x, grid_size: (f, h, w) |
| 585 | |
| 586 | def unpatchify(self, x: torch.Tensor, grid_size: torch.Tensor): |
| 587 | return rearrange( |