Skip to content

Commit aebdae2

Browse files
SebastianAmentfacebook-github-bot
authored andcommitted
Tuple-based indexing for MVar.get_mvar_set_via_counting (#2888)
Summary: Pull Request resolved: #2888 This commit changes list-based indexing to a tuple-based indexing in `MVaR`, which is currently throwing a warning: ``` UserWarning: Using a non-tuple sequence for multidimensional indexing is deprecated and will be changed in pytorch 2.9; use x[tuple(seq)] instead of x[seq]. In pytorch 2.9 this will be interpreted as tensor index, x[torch.tensor(seq)], which will result either in an error or a different result counter_tensor[slices] += 1 ``` Reviewed By: saitcakmak Differential Revision: D76913735 fbshipit-source-id: ac532ffc8394c5d5cdb16e8f9473ad66a0770099
1 parent 6c2d57f commit aebdae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

botorch/acquisition/multi_objective/multi_output_risk_measures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def get_mvar_set_via_counting(self, Y: Tensor) -> list[Tensor]:
353353
Y_pruned = Y[mask]
354354
for y_ in Y_pruned:
355355
starting_idcs = [unique_outcomes[i].get(y_[i].item(), 0) for i in range(m)]
356-
slices = [slice(s_idx, None) for s_idx in starting_idcs]
356+
slices = tuple(slice(s_idx, None) for s_idx in starting_idcs)
357357
counter_tensor[slices] += 1
358358

359359
# Get the count alpha-level points should have.

0 commit comments

Comments
 (0)