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 11[project ]
22name = " vector-quantize-pytorch"
3- version = " 1.22.12 "
3+ version = " 1.22.15 "
44description = " Vector Quantization - Pytorch"
55authors = [
66 { name = " Phil Wang" , email = " lucidrains@gmail.com" }
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def forward(
190190
191191 all_indices = []
192192
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 ()
194194
195195 # sample a layer index at which to dropout further residual quantization
196196 # also prepare null indices
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ def forward(
152152 all_losses = []
153153 all_indices = []
154154
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 ()
156156
157157 # sample a layer index at which to dropout further residual quantization
158158 # also prepare null indices and loss
You can’t perform that action at this time.
0 commit comments