code: def convert_to_one_hot(
      targets, num_classes, on_value=1.0, off_value=0.0
  ):
      """
      This function converts target class indices to one-hot vectors, given the
      number of classes.
      Args:
          targets (loader): Class labels.
          num_classes (int): Total number of classes.
          on_value (float): Target Value for ground truth class.
          off_value (float): Target Value for other classes.This value is used for
              label smoothing.
      """
  
      targets = targets.long().view(-1, 1)
      return torch.full(
          (targets.size()[0], num_classes),
          off_value,
          device=targets.device,
      ).scatter_(1, targets, on_value)
  
file_path: SlowFast/slowfast/datasets/mixup.py
imports: import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_one_hot(targets, num_classes, on_value, off_value) and returns: torch