code: def load_train_data(dir_path="cifar-10-batches-py", num_batches=5):
      labels = []
      batchsize = 10000
      images = np.empty(
          (num_batches * batchsize, 3, 32, 32), dtype=np.uint8
      )
      for did in range(1, num_batches + 1):
          fname_train_data = dir_path + "/data_batch_{}".format(did)
          image, label = load_dataset(
              check_dataset_exist(fname_train_data)
          )
          images[(did - 1) * batchsize : did * batchsize] = image
          labels.extend(label)
      images = np.array(images, dtype=np.float32)
      labels = np.array(labels, dtype=np.int32)
      return images, labels
  
imports: from singa import singa_wrap
  from singa import autograd
  from singa import tensor
  from singa import device
  from singa import opt
  from PIL import Image
  import numpy
  import os
  import sys
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: load_train_data(dir_path, num_batches) and returns: images,  labels