Skip to content

Commit

Permalink
quick fix for get_codes_from_indices
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Mar 19, 2024
1 parent 6102e37 commit 0f970c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'vector_quantize_pytorch',
packages = find_packages(),
version = '1.14.1',
version = '1.14.2',
license='MIT',
description = 'Vector Quantization - Pytorch',
long_description_content_type = 'text/markdown',
Expand Down
3 changes: 1 addition & 2 deletions vector_quantize_pytorch/vector_quantize_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ def get_codes_from_indices(self, indices):
is_multiheaded = codebook.ndim > 2

if not is_multiheaded:
codes = codebook[indices]
return rearrange(codes, '... h d -> ... (h d)')
return codebook[indices]

indices, ps = pack_one(indices, 'b * h')
indices = rearrange(indices, 'b n h -> b h n')
Expand Down

0 comments on commit 0f970c4

Please sign in to comment.