From 7312cf694559e3e7825760de22314c96921b6da5 Mon Sep 17 00:00:00 2001 From: Max Balandat Date: Sat, 21 Sep 2024 09:52:46 -0700 Subject: [PATCH] Use stable sorting in prune_inferior_points --- botorch/acquisition/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botorch/acquisition/utils.py b/botorch/acquisition/utils.py index 31ef10baa4..ae4f054321 100644 --- a/botorch/acquisition/utils.py +++ b/botorch/acquisition/utils.py @@ -344,7 +344,7 @@ def prune_inferior_points( idcs, counts = torch.unique(is_best, return_counts=True) if len(idcs) > max_points: - counts, order_idcs = torch.sort(counts, descending=True) + counts, order_idcs = torch.sort(counts, stable=True, descending=True) idcs = order_idcs[:max_points] return X[idcs]