code: def AddInput(model, batch_size, db, db_type):
      # load the data
      data_uint8, label = model.TensorProtosDBInput(
          [],
          ["data_uint8", "label"],
          batch_size=batch_size,
          db=db,
          db_type=db_type,
      )
      # cast the data to float
      data = model.Cast(data_uint8, "data", to=core.DataType.FLOAT)
      # scale data from [0,255] down to [0,1]
      data = model.Scale(data, data, scale=float(1.0 / 256))
      # don't need the gradient for the backward pass
      data = model.StopGradient(data, data)
      return data, label
  
file_path: pytorch-tensorboardx/examples/demo_caffe2.py
imports: import numpy
  import os
  import shutil
  from caffe2.python import core, model_helper, workspace, brew
  from tensorboardX import TorchVis
label_desc: Use image node_id 2 for calling a global function with example usage: AddInput(model, batch_size, db, db_type) and returns: data,  label