class_docstr: Loads data from a list of datasets and returns mini-batches of data.
  
  One dataset is loaded at a time.
  
  Parameters
  ----------
  file_patterns: str
      Path to the input text files.
  file_sampler : str or gluon.data.Sampler, defaults to 'random'
      The sampler used to sample a file. The following string values are supported:
  
      - 'sequential': SequentialSampler
      - 'random': RandomSampler
  dataset_fn : DatasetFn, callable
      Callable object to generate a gluon.data.Dataset given a url.
  batch_sampler_fn : SamplerFn, callable
      Callable object to generate a gluon.data.sampler.Sampler given a dataset.
  dataset_params : dict, default is None
      Dictionary of parameters passed to dataset_fn.
  batch_sampler_params : dict, default is None
      Dictionary of parameters passed to batch_sampler_fn.
  batchify_fn : callable
      Callback function to allow users to specify how to merge samples
      into a batch. Defaults to `default_batchify_fn`::
  
          def default_batchify_fn(data):
              if isinstance(data[0], nd.NDArray):
                  return nd.stack(*data)
              elif isinstance(data[0], tuple):
                  data = zip(*data)
                  return [default_batchify_fn(i) for i in data]
              else:
                  data = np.asarray(data)
                  return nd.array(data, dtype=data.dtype)
  num_dataset_workers : int
      Number of worker process for dataset creation.
  num_batch_workers : int
      Number of worker process for batch creation.
  pin_memory : boolean, default False
      If ``True``, the dataloader will copy NDArrays into pinned memory
      before returning them. Copying from CPU pinned memory to GPU is faster
      than from normal CPU memory. At the same time, it increases GPU memory.
  circle_length : int, default is 1
      The number of files to be read at the same time. When `circle_length` is larger than 1,
      we merge `circle_length` number of files.
  dataset_prefetch : int, default is `num_dataset_workers`
      The number of prefetching datasets only works if `num_workers` > 0.
      If `prefetch` > 0, it allow worker process to prefetch certain datasets before
      acquiring data from iterators.
      Note that using large prefetching batch will provide smoother bootstrapping performance,
      but will consume more memory. Using smaller number may forfeit the purpose of using
      multiple worker processes, try reduce `num_dataset_workers` in this case.
      By default it defaults to `num_dataset_workers`.
  batch_prefetch : int, default is `num_batch_workers * 2`
      The number of prefetching batches only works if `num_workers` > 0.
      If `prefetch` > 0, it allow worker process to prefetch certain batches before
      acquiring data from iterators.
      Note that using large prefetching batch will provide smoother bootstrapping performance,
      but will consume more shared_memory. Using smaller number may forfeit the purpose of using
      multiple worker processes, try reduce `num_batch_workers` in this case.
      By default it defaults to `num_batch_workers * 2`.
  dataset_cached : bool, default is False
      Whether or not to cache last processed dataset. Each processed dataset can
      only be cached for once. When there is no new available processed dataset to be fetched,
      we pop a cached processed dataset.
  num_max_dataset_cached : int, default is 0
      Maximum number of cached datasets. It is valid only if `dataset_cached` is True
code: def __del__(self):
      if self._dataset_worker_pool:
          # manually terminate due to a bug that pool is not automatically terminated
          # https://bugs.python.org/issue34172
          assert isinstance(
              self._dataset_worker_pool, multiprocessing.pool.Pool
          )
          self._dataset_worker_pool.terminate()
      if self._batch_worker_pool:
          assert isinstance(
              self._batch_worker_pool, multiprocessing.pool.Pool
          )
          self._batch_worker_pool.terminate()
  
imports: import io
  import os
  import gc
  import glob
  import pickle
  import warnings
  import multiprocessing
  from functools import partial
  import numpy
  from mxnet import context, npx
  from mxnet.gluon.data import ArrayDataset, SimpleDataset
  from mxnet.gluon.data.dataloader import ForkingPickler, _as_in_context, default_mp_batchify_fn, default_batchify_fn
label_desc: Use image node_id 3 for calling the DatasetLoader obj's underlying member method code with example usage: obj.__del__() without return types