code: def to_one_hot(y, num_classes=10):
      """
      Take a batch of label y with n dims and convert it to
      1-hot representation with n+1 dims.
      Link: https://discuss.pytorch.org/t/convert-int-into-one-hot-format/507/24
      """
      y = replicate_input(y).view(-1, 1)
      y_one_hot = y.new_zeros((y.size()[0], num_classes)).scatter_(
          1, y, 1
      )
      return y_one_hot
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 11 for calling a global function with example usage: to_one_hot(y, num_classes) and returns: y_one_hot