code: def get_batch_dali(batch_size, pipe_type, label_type, num_gpus=1):
      pipes = [
          pipe_type(
              batch_size=batch_size,
              num_threads=2,
              device_id=device_id,
              num_gpus=num_gpus,
          )
          for device_id in range(num_gpus)
      ]
  
      daliop = dali_tf.DALIIterator()
      images = []
      labels = []
      for d in range(NUM_GPUS):
          with tf.device("/gpu:%i" % d):
              image, label = daliop(
                  pipeline=pipes[d],
                  shapes=[(batch_size, 3, 227, 227), ()],
                  dtypes=[tf.int32, label_type],
                  device_id=d,
              )
              images.append(image)
              labels.append(label)
  
      return [images, labels]
  
imports: import numpy
  import nvidia.dali.ops
  import nvidia.dali.plugin.tf
  import nvidia.dali.types
  import os.path
  import tensorflow
  from nvidia.dali.pipeline import Pipeline
  from nose_utils import raises
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 1 for calling a global function with example usage: get_batch_dali(batch_size, pipe_type, label_type, num_gpus) and returns: list