(self, x)
| 39 | self.post_quant_conv = nn.Conv2d(config.codebook_embed_dim, config.z_channels, 1) |
| 40 | |
| 41 | def encode(self, x): |
| 42 | h = self.encoder(x) |
| 43 | h = self.quant_conv(h) |
| 44 | quant, emb_loss, info = self.quantize(h) |
| 45 | return quant, emb_loss, info |
| 46 | |
| 47 | def decode(self, quant): |
| 48 | quant = self.post_quant_conv(quant) |