class_docstr: Specific head for training MSN (https://arxiv.org/pdf/2204.07141.pdf).
class_docstr_tok: ["Specific","head","for","training","MSN","(","https",":","\/\/arxiv.org\/pdf\/2204.07141.pdf",")","."]
code: def one_hot(targets, num_classes, smoothing):
      off_value = smoothing / num_classes
      on_value = 1.0 - smoothing + off_value
      targets = targets.long().view(-1, 1)
      return torch.full(
          (len(targets), num_classes), off_value
      ).scatter_(1, targets, on_value)
  
file_path: vissl/vissl/models/heads/msn_head.py
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from vissl.config import AttrDict
  from vissl.models.heads import register_model_head
  from vissl.models.model_helpers import trunc_normal_
label_desc: Use image node_id 2 for calling the MSNHead obj's underlying member method code with example usage: obj.one_hot(targets, num_classes, smoothing) and returns: torch