lucidrains / vector-quantize-pytorch

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

Work on LatentQuantizer #128

Closed MisterBourbaki closed 6 months ago

MisterBourbaki commented 6 months 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