code: def fn_x_mnist(x, use_cuda):
      # normalize pixel values of the image to be in [0,1] instead of [0,255]
      xp = x * (1.0 / 255)
  
      # transform x to a linear tensor from bx * a1 * a2 * ... --> bs * A
      xp_1d_size = reduce(lambda a, b: a * b, xp.size()[1:])
      xp = xp.view(-1, xp_1d_size)
  
      # send the data to GPU(s)
      if use_cuda:
          xp = xp.cuda()
  
      return xp
  
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 1 for calling a global function with example usage: fn_x_mnist(x, use_cuda) and returns: xp