Skip to content

Commit 3d4fca0

Browse files
committed
fix logic determining whether indices is image / video shape in lfq
1 parent f6ebbc1 commit 3d4fca0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'vector_quantize_pytorch',
55
packages = find_packages(),
6-
version = '1.9.16',
6+
version = '1.9.18',
77
license='MIT',
88
description = 'Vector Quantization - Pytorch',
99
long_description_content_type = 'text/markdown',

vector_quantize_pytorch/lookup_free_quantization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def indices_to_codes(
129129
indices,
130130
project_out = True
131131
):
132-
is_img_or_video = indices.ndim >= 3
132+
is_img_or_video = indices.ndim >= (3 + int(self.keep_num_codebooks_dim))
133133

134134
if not self.keep_num_codebooks_dim:
135135
indices = rearrange(indices, '... -> ... 1')

0 commit comments

Comments
 (0)