code: def fn_y_mnist(y, use_cuda):
      yp = torch.zeros(y.size(0), 10)
  
      # send the data to GPU(s)
      if use_cuda:
          yp = yp.cuda()
          y = y.cuda()
  
      # transform the label y (integer between 0 and 9) to a one-hot
      yp = yp.scatter_(1, y.view(-1, 1), 1.0)
      return yp
  
file_path: pyro/examples/vae/utils/mnist_cached.py
imports: import errno
  import os
  from functools import reduce
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from pyro.contrib.examples.util import MNIST, get_data_directory
label_desc: Use image node_id 2 for calling a global function with example usage: fn_y_mnist(y, use_cuda) and returns: yp