Skip to content

Commit

Permalink
reword comments
Browse files Browse the repository at this point in the history
The purpose of `input_size` is to be able to reshape the quantized output back to its original shape

Signed-off-by: reinvantveer <rein@vantveer.me>
  • Loading branch information
reinvantveer committed Jun 27, 2022
1 parent 47a5f66 commit a2e2b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/generative/vq_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def __init__(self, num_embeddings, embedding_dim, beta=0.25, **kwargs):
)

def call(self, x):
# Calculate the input shape of the inputs and
# then flatten the inputs keeping `embedding_dim` intact.
# Memorize the input shape of the inputs
input_shape = tf.shape(x)
# Then flatten the inputs, keeping `embedding_dim` intact.
flattened = tf.reshape(x, [-1, self.embedding_dim])

# Quantization.
Expand Down

0 comments on commit a2e2b45

Please sign in to comment.