File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 3
3
setup (
4
4
name = 'vector_quantize_pytorch' ,
5
5
packages = find_packages (),
6
- version = '1.12.4 ' ,
6
+ version = '1.12.5 ' ,
7
7
license = 'MIT' ,
8
8
description = 'Vector Quantization - Pytorch' ,
9
9
long_description_content_type = 'text/markdown' ,
Original file line number Diff line number Diff line change 19
19
def exists (val ):
20
20
return val is not None
21
21
22
+ def first (l ):
23
+ return l [0 ]
24
+
22
25
def default (val , d ):
23
26
return val if exists (val ) else d
24
27
@@ -59,7 +62,7 @@ def __init__(
59
62
scales = []
60
63
61
64
for ind in range (num_quantizers ):
62
- scales .append (levels_tensor ** - ind )
65
+ scales .append (( levels_tensor - 1 ) ** - ind )
63
66
64
67
fsq = FSQ (
65
68
levels = levels ,
@@ -146,7 +149,7 @@ def forward(
146
149
x = self .project_in (x )
147
150
148
151
quantized_out = 0.
149
- residual = x
152
+ residual = first ( self . layers ). bound ( x )
150
153
151
154
all_indices = []
152
155
You can’t perform that action at this time.
0 commit comments