Skip to content

Commit

Permalink
Reflects the changes in borchero#59
Browse files Browse the repository at this point in the history
  • Loading branch information
tenk-9 committed Jul 2, 2024
1 parent 3d25c64 commit bdfb751
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pycave/clustering/kmeans/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def update(self, data: torch.Tensor, shortest_distances: torch.Tensor) -> None:

# Then, we sample from the data `num_choices` times and replace if needed
choices = (squared_distances + eps).multinomial(self.num_choices, replacement=True)
self.choices = self.choices.to(data.dtype)
self.choices.masked_scatter_(
use_choice_from_data.unsqueeze(1), data[choices[use_choice_from_data]]
)
Expand Down

0 comments on commit bdfb751

Please sign in to comment.