code: def batch_reduced_vol(batch, axes):
      reduced_vol = 0
      if axes is None:
          for x in batch:
              reduced_vol += np.prod(x.shape)
      else:
          for x in batch:
              v = 1
              sh = x.shape
              for a in axes:
                  v *= sh[a]
              reduced_vol += v
      return reduced_vol
  
imports: from nvidia.dali.pipeline import Pipeline
  from nvidia.dali import backend
  import nvidia.dali.ops
  import numpy
  from test_utils import dali_type
  from nvidia.dali import fn, pipeline_def, types
  from nose2.tools import params
label_desc: Use image node_id 2 for calling a global function with example usage: batch_reduced_vol(batch, axes) and returns: reduced_vol