(self, x)
| 190 | return quantize |
| 191 | |
| 192 | def encode(self, x): |
| 193 | shape = x.shape |
| 194 | # pre-process |
| 195 | x = self.preprocess(x) |
| 196 | # quantize |
| 197 | embed_ind = self.quantize(x) |
| 198 | # post-process |
| 199 | embed_ind = self.postprocess_emb(embed_ind, shape) |
| 200 | return embed_ind |
| 201 | |
| 202 | def decode(self, embed_ind): |
| 203 | quantize = self.dequantize(embed_ind) |
no test coverage detected