summaryrefslogtreecommitdiff
path: root/text_recognizer
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-09-18 17:44:19 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-09-18 17:44:19 +0200
commitf9ede1e61008ead9b7abe910dff79067cf862312 (patch)
treed6d9b98e6e40c03c2bc3f422083de57fd548761c /text_recognizer
parent71ffa32966c7cc60802244c5e16998da5c5c3ce4 (diff)
Add comment for quantization
Diffstat (limited to 'text_recognizer')
-rw-r--r--text_recognizer/networks/vqvae/vqvae.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/text_recognizer/networks/vqvae/vqvae.py b/text_recognizer/networks/vqvae/vqvae.py
index e8660c4..f31b062 100644
--- a/text_recognizer/networks/vqvae/vqvae.py
+++ b/text_recognizer/networks/vqvae/vqvae.py
@@ -38,6 +38,7 @@ class VQVAE(nn.Module):
return self.pre_codebook_conv(z_e)
def quantize(self, z_e: Tensor) -> Tuple[Tensor, Tensor]:
+ """Quantizes the encoded latent vectors."""
z_q, vq_loss = self.quantizer(z_e)
return z_q, vq_loss