docstr: This function takes one-hot or index target vectors and computes valid one-hot
  target vectors, based on ignore index value
code: def compute_valid_targets(self, target, classes):
      """
      This function takes one-hot or index target vectors and computes valid one-hot
      target vectors, based on ignore index value
      """
      target_shape_list = list(target.size())
  
      valid_mask = target != self._ignore_index
      valid_targets = target.float() * valid_mask.float()
  
      # check if targets are inputted as class integers
      if len(target_shape_list) == 1 or (
          len(target_shape_list) == 2 and target_shape_list[1] == 1
      ):
          valid_targets = convert_to_one_hot(
              valid_targets.view(-1, 1), classes
          )
          valid_targets = (
              valid_targets.float() * valid_mask.view(-1, 1).float()
          )
  
      return valid_targets
  
file_path: ClassyVision/classy_vision/losses/label_smoothing_loss.py
imports: from typing import Any, Dict
  import numpy
  from classy_vision.generic.util import convert_to_one_hot
  from classy_vision.losses import ClassyLoss, register_loss
  from classy_vision.losses.soft_target_cross_entropy_loss import SoftTargetCrossEntropyLoss
label_desc: Use image node_id 3 for calling the LabelSmoothingCrossEntropyLoss obj's underlying member method code with example usage: obj.compute_valid_targets(target, classes) and returns: valid_targets