(self, x)
| 77 | return self._vae.encode(x).sample() |
| 78 | |
| 79 | def encode(self, x): # raw pixels => raw latents |
| 80 | self.init(x.device) |
| 81 | x = x.to(torch.float32) / 127.5 - 1 |
| 82 | x = torch.cat([self._run_vae_encoder(batch) for batch in x.split(self.batch_size)]) |
| 83 | return x |
| 84 | |
| 85 | #---------------------------------------------------------------------------- |
| 86 |
no test coverage detected