Args: z: torch.Tensor, shape (b, latent_channels, h, w)
(self, z)
| 74 | |
| 75 | @torch.no_grad() |
| 76 | def decode(self, z): |
| 77 | """ |
| 78 | Args: |
| 79 | z: torch.Tensor, shape (b, latent_channels, h, w) |
| 80 | """ |
| 81 | # scale to [-1, 1] |
| 82 | return self.decoder(z).mul(2).sub(1) |
| 83 | |
| 84 | def guess_latent_channels(self, encoder_path): |
| 85 | """guess latent channel count based on encoder filename""" |