(self, latents, parallel=False)
| 251 | |
| 252 | @torch.no_grad() |
| 253 | def decode(self, latents, parallel=False): |
| 254 | if latents.ndim == 4: |
| 255 | latents = latents.unsqueeze(0) |
| 256 | |
| 257 | if self.need_scaled: |
| 258 | latents_mean = torch.tensor(self.latents_mean).view(1, self.z_dim, 1, 1, 1).to(latents.device, latents.dtype) |
| 259 | latents_std = 1.0 / torch.tensor(self.latents_std).view(1, self.z_dim, 1, 1, 1).to(latents.device, latents.dtype) |
| 260 | latents = latents / latents_std + latents_mean |
| 261 | |
| 262 | return self.taehv.decode_video(latents.transpose(1, 2).to(self.dtype), parallel=parallel, show_progress_bar=False).transpose(1, 2).mul_(2).sub_(1) |
| 263 | |
| 264 | @torch.no_grad() |
| 265 | def encode_video(self, vid): |
nothing calls this directly
no test coverage detected