After the nearest code is chosen, the quantized latent is simply that code vector. The decoder receives the code, so the index is all it needs to reconstruct the image.
Implement quantize(codebook, idx), which returns the code vectors at the given indices.
Index the codebook with idx.
No results yet
Run your code to check it against the examples, or submit to run every test.