code: def run_reduce_with_mean_input(
      keep_dims,
      reduction_name,
      batch_gen,
      input_type,
      output_type=None,
      layout=None,
  ):
      batch_fn = batch_gen(input_type)
      dali_reduce_fn, numpy_reduce_fn = reduce_fns[reduction_name]
  
      for axes in batch_fn.valid_axes():
          if axes == ():
              valid_ddofs = [0]
          elif axes is None:
              valid_ddofs = [0, 1, 2, 3]
          else:
              valid_ddofs = [0, 1]
          for ddof in valid_ddofs:
              dali_res_cpu, dali_res_gpu = run_dali(
                  dali_reduce_fn,
                  batch_fn,
                  keep_dims=keep_dims,
                  axes=axes,
                  output_type=output_type,
                  add_mean_input=True,
                  ddof=ddof,
                  layout=layout,
              )
  
              batch_fn.reset()
  
              np_res = run_numpy(
                  numpy_reduce_fn,
                  batch_fn,
                  keep_dims=keep_dims,
                  axes=axes,
                  output_type=output_type,
                  ddof=ddof,
              )
  
              for iteration in range(batch_fn.num_iter()):
                  compare(dali_res_cpu[iteration], np_res[iteration])
                  compare(dali_res_gpu[iteration], np_res[iteration])
  
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 15 for calling a global function with example usage: run_reduce_with_mean_input(keep_dims, reduction_name, batch_gen, input_type, output_type, layout) without return types