code: def prepare_pytorch(x):
      import torch
  
      if isinstance(x, torch.autograd.Variable):
          x = x.data
      x = x.cpu().numpy()
      return x
  
file_path: pytorch-tensorboardx/tensorboardX/x2num.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_pytorch(x) and returns: x