File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " vector-quantize-pytorch"
3
- version = " 1.22.12 "
3
+ version = " 1.22.15 "
4
4
description = " Vector Quantization - Pytorch"
5
5
authors = [
6
6
{ name = " Phil Wang" , email = " lucidrains@gmail.com" }
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def forward(
190
190
191
191
all_indices = []
192
192
193
- should_quantize_dropout = self .training and self .quantize_dropout
193
+ should_quantize_dropout = self .training and self .quantize_dropout and torch . is_grad_enabled ()
194
194
195
195
# sample a layer index at which to dropout further residual quantization
196
196
# also prepare null indices
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ def forward(
152
152
all_losses = []
153
153
all_indices = []
154
154
155
- should_quantize_dropout = self .training and self .quantize_dropout
155
+ should_quantize_dropout = self .training and self .quantize_dropout and torch . is_grad_enabled ()
156
156
157
157
# sample a layer index at which to dropout further residual quantization
158
158
# also prepare null indices and loss
You can’t perform that action at this time.
0 commit comments