(self, images)
| 81 | ]) |
| 82 | |
| 83 | def encode_images(self, images): |
| 84 | with torch.no_grad(): |
| 85 | if not images.is_cuda: |
| 86 | images = images.cuda() |
| 87 | |
| 88 | B, C, H, W = images.shape |
| 89 | self._current_img_h = H |
| 90 | self._current_img_w = W |
| 91 | |
| 92 | latents = self.model.get_reconstruction_latents(images) |
| 93 | return latents.detach().cpu() |
| 94 | |
| 95 | def decode_to_images(self, z): |
| 96 | with torch.no_grad(): |
no test coverage detected