code: def pool_map(func, args, batch_size, verbose=False, pool=None):
      """A wrapper of multiprocessing.pool.Pool.map to support small-batch mapping
      for large argument list. This can reduce memory usage
  
      Parameters
      ----------
      func: Func(arg) -> np.ndarray
          mapping function
      args: List
          list of arguments
      batch_size: int
          batch size in mapping
      verbose: bool, optional
          whether print progress
      pool: multiprocessing.Pool, optional
          pool objection
  
      Returns
      -------
      converted numpy array
      """
  
      ret = None
      tic = time.time()
      local_pool = pool or PopenPoolExecutor()
      if verbose:
          logger.info("mapping begin")
      for i in range(0, len(args), batch_size):
          if verbose:
              logger.info(
                  "mapping %d/%d elapsed %.2f",
                  i,
                  len(args),
                  time.time() - tic,
              )
          tmp = np.array(local_pool.map(func, args[i : i + batch_size]))
          ret = tmp if ret is None else np.concatenate((ret, tmp))
      if verbose:
          logger.info("mapping done")
      if not pool:
          local_pool.close()
      return ret
  
file_path: tvm/python/tvm/autotvm/utils.py
imports: import logging
  import time
  import numpy
  import tvm.arith
  from tvm.tir import expr
  from tvm.contrib.popen_pool import PopenPoolExecutor
label_desc: Use image node_id 2 for calling a global function with example usage: pool_map(func, args, batch_size, verbose, pool) and returns: ret