Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in FSQ, with return_indices to False and image-type feature input #139

Open
MisterBourbaki opened this issue Jun 20, 2024 · 0 comments

Comments

@MisterBourbaki
Copy link
Contributor

The new version of FSQ, with the possibility to not compute indices and return only None, has a small bug:

from vector_quantize_pytorch.finite_scalar_quantization import FSQ
import torch

quantizer = FSQ(levels=[8,5,5,5], return_indices=False)
images = torch.rand(1, 4, 32, 32)

quantizer(images)

the code above will raise a RuntimeError, as Einops try here to unpack None.

I will shortly propose a PR, which solves the issue and clean a bit the code, for better readability and ease of use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant