MCPcopy
hub / github.com/FoundationVision/LlamaGen / encode

Method encode

tokenizer/tokenizer_image/vq_model.py:41–45  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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)

Callers 3

forwardMethod · 0.95
mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected