def _upsample()

in privacy_lint/attack_results.py [0:0]


    def _upsample(scores: torch.Tensor, delta: int) -> torch.Tensor:
        """
        Upsamples scores by fist shuffling it and concatenating it
        as many times as necessary to add delta samples.
        """

        n = len(scores)
        perm = torch.randperm(n)
        shuffled_scores = scores[perm]
        n_chunks = delta // n + 2

        return torch.cat([shuffled_scores] * n_chunks)[: n + delta]