def select_coreset_idxs(
            self, selected_idxs: Optional[List[int]]=None) -> List[int]:
        """Greedily form a coreset to minimize the maximum distance of a cluster.

        Args:
            selected_idxs: index of samples already selected. Defaults to an empty set.

        Returns:
          indices of samples selected to minimize distance to cluster centers
        """

        if selected_idxs is None:
            selected_idxs = []
        #w = torch.load('../anomalib/random_matrix.pth',map_location=torch.device('cpu')).numpy()
        if self.embedding.ndim == 2:
            self.model.fit(self.embedding)
            self.features = self.model.transform(self.embedding)
            self.reset_distances()
        else:
            self.features = self.embedding.reshape(
                (self.embedding.shape[0], -1))
            self.update_distances(cluster_centers=selected_idxs)

        selected_coreset_idxs = []
        idx = paddle.randint(high=self.n_observations, shape=(1, ))  #.item()
        for _ in (range(self.coreset_size)):
            self.update_distances(cluster_centers=[idx])
            idx = paddle.argmax(self.min_distances)
            #if idx in selected_idxs:
            #    raise ValueError("New indices should not be in selected indices.")
            self.min_distances[idx] = 0
            selected_coreset_idxs.append(idx)

        return paddle.concat(selected_coreset_idxs)
Greedily form a coreset to minimize the maximum distance of a cluster.

        Args:
            selected_idxs: index of samples already selected. Defaults to an empty set.

        Returns:
          indices of samples selected to minimize distance to cluster centers
        
contrib/QualityInspector/qinspector/uad/utils/k_center_greedy.py