Skip to content

Commit 0de206d

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

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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.17',
77
license='MIT',
88
description = 'Vector Quantization - Pytorch',
99
long_description_content_type = 'text/markdown',

vector_quantize_pytorch/lookup_free_quantization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def indices_to_codes(
129129
indices,
130130
project_out = True
131131
):
132-
is_img_or_video = indices.ndim >= 3
133-
132+
is_img_or_video = indices.ndim >= (3 + int(self.keep_num_codebooks_dim))
133+
print(is_img_or_video)
134134
if not self.keep_num_codebooks_dim:
135135
indices = rearrange(indices, '... -> ... 1')
136136

0 commit comments

Comments
 (0)