class_docstr: Implementation of SmoothMix training, as introduced in Jeong et al. (2021)
  
  | Paper link: https://arxiv.org/abs/2111.09277
class_docstr_tok: ["Implementation","of","SmoothMix","training",",","as","introduced","in","Jeong","et","al",".","(","2021",")","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2111.09277"]
docstr: Returns mixed inputs and labels.
  
  :param inputs: Training data
  :param inputs_adv: Adversarial training data
  :param labels: Training labels
docstr_tok: ["Returns","mixed","inputs","and","labels",".",":","param","inputs",":","Training","data",":","param","inputs_adv",":","Adversarial","training","data",":","param","labels",":","Training","labels"]
code: 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
  
file_path: adversarial-robustness-toolbox/art/estimators/certification/randomized_smoothing/smooth_mix/pytorch.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import List, Optional, Tuple, Union, TYPE_CHECKING
  from tqdm.auto import trange
  import numpy
  from art.estimators.certification.randomized_smoothing.pytorch import PyTorchRandomizedSmoothing
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 4 for calling the PyTorchSmoothMix obj's underlying member method code with example usage: obj._mix_data(inputs, inputs_adv, labels) and returns: mixed_inputs,  mixed_labels