lucidrains / vector-quantize-pytorch

Vector (and Scalar) Quantization, in Pytorch
MIT License
2.12k stars 179 forks source link

Work on LatentQuantizer #128

Closed MisterBourbaki closed 1 month ago

MisterBourbaki commented 1 month ago

This proposition is both a refacto of a few parts of the LatentQuantizer, and the resolution of some bugs. The changes have been checked consistently by the addition of a dedicated test file which covers (almost) all the code in LatentQuantize.

The main goal was to improve the code by simplifying as much as possible the multiple branches: same levels or not, images or video or not, etc. The code now deals the kind of input the same way, as it does for the way levels are provided (by a list or int).

I will happily answer any question about my PR :)

Here is a list of the proposed modifications and their details:

Addition

Fixes

Format

Removes