code: def ref_iter(epochs=1, device="cpu"):
      for _ in range(epochs):
          for filename in filenames:
              pipe = reference_pipeline(filename, device=device)
              pipe.build()
              (output,) = pipe.run()
              if isinstance(output, TensorListGPU):
                  output = output.as_cpu()
              yield np.array(output[0])
  
imports: import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  import numpy
  import cv2
  import nvidia.dali.types
  import glob
  from itertools import cycle
  from test_utils import get_dali_extra_path, is_mulit_gpu
  from nvidia.dali.backend import TensorListGPU
  from nose2.tools import params
  from nose import SkipTest
  from nose.plugins.attrib import attr
label_desc: Use image node_id 6 for calling a global function with example usage: ref_iter(epochs, device) without return types