Skip to content

Commit 536a279

Browse files
Balandatgpleiss
andauthored
Fix in-place modification on kernel __getitem__ (#1811)
Should fix #1809 (can't test locally due to #1810) Co-authored-by: Geoff Pleiss <[email protected]>
1 parent 4f5d670 commit 536a279

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gpytorch/kernels/kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def __getitem__(self, index):
433433
new_kernel.batch_shape = new_kernel._parameters[param_name].shape[:new_batch_shape_len]
434434

435435
for sub_module_name, sub_module in self.named_sub_kernels():
436-
self._modules[sub_module_name] = sub_module.__getitem__(index)
436+
new_kernel._modules[sub_module_name] = sub_module.__getitem__(index)
437437

438438
return new_kernel
439439

0 commit comments

Comments
 (0)