def _mix_data(
        self, inputs: "torch.Tensor", inputs_adv: "torch.Tensor", labels: "torch.Tensor"
    ) -> tuple["torch.Tensor", "torch.Tensor"]:
        """
        Returns mixed inputs and labels.

        :param inputs: Training data
        :param inputs_adv: Adversarial training data
        :param labels: Training labels
        """
        import torch

        eye = torch.eye(self.nb_classes, device=self.device)
        unif = eye.mean(0, keepdim=True)
        lam = torch.rand(inputs.size(0), device=self.device) / 2

        mixed_inputs = (1 - lam).view(-1, 1, 1, 1) * inputs + lam.view(-1, 1, 1, 1) * inputs_adv
        mixed_labels = (1 - lam).view(-1, 1) * labels + lam.view(-1, 1) * unif

        return mixed_inputs, mixed_labels

        Returns mixed inputs and labels.

        :param inputs: Training data
        :param inputs_adv: Adversarial training data
        :param labels: Training labels
        
art/estimators/certification/randomized_smoothing/smooth_mix/pytorch.py