code: def test_reduce():
      reductions = ["sum", "min", "max"]
      batch_gens = [Batch1D, Batch2D, Batch3D]
      types = [
          np.uint8,
          np.int8,
          np.uint16,
          np.int16,
          np.uint32,
          np.int32,
          np.uint64,
          np.int64,
          np.float32,
      ]
  
      rng = np.random.default_rng(1000)
      for keep_dims in [False, True]:
          for reduction_name in reductions:
              for ndim, batch_gen in enumerate(batch_gens, start=1):
                  type_id = rng.choice(types)
                  layout = rng.choice([None, "XYZ"[:ndim]])
                  yield run_reduce, keep_dims, reduction_name, batch_gen, type_id, None, layout
  
imports: import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  from nose.tools import nottest
  import numpy
  from test_utils import np_type_to_dali
  from nose_utils import assert_raises
label_desc: Use image node_id 9 for calling a global function with example usage: test_reduce() without return types