code: def test_variable_batch():
      pipe = Pipeline(6, 1, 0)
      batches = [
          [np.array(1), np.array(2)],
          [np.array(1)],
          [
              np.array(1),
              np.array(2),
              np.array(3),
              np.array(4),
              np.array(5),
              np.array(5),
          ],
      ]
      dummy = fn.external_source(batches, cycle=True)
      val = np.float32([[1, 2], [3, 4]])
      pipe.set_outputs(
          types.Constant(val, device="cpu"),
          types.Constant(val, device="gpu"),
          dummy,
      )
      pipe.build()
      for batch in batches:
          cpu, gpu, _ = pipe.run()
          assert len(cpu) == len(batch)
          assert len(gpu) == len(batch)
          gpu = gpu.as_cpu()
          for i in range(len(batch)):
              assert np.array_equal(cpu.at(i), val)
              assert np.array_equal(gpu.at(i), val)
  
imports: import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.ops
  import nvidia.dali.types
  import os
  from nvidia.dali import Pipeline
  from test_utils import check_batch
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 8 for calling a global function with example usage: test_variable_batch() without return types