class_docstr: Implements a dataset wrapper for fast data loading
  
  >>> from doctr.datasets import CORD, DataLoader
  >>> train_set = CORD(train=True, download=True)
  >>> train_loader = DataLoader(train_set, batch_size=32)
  >>> train_iter = iter(train_loader)
  >>> images, targets = next(train_iter)
  
  Args:
  ----
      dataset: the dataset
      shuffle: whether the samples should be shuffled before passing it to the iterator
      batch_size: number of elements in each batch
      drop_last: if `True`, drops the last batch if it isn't full
      num_workers: number of workers to use for data loading
      collate_fn: function to merge samples into a batch
code: def __init__(
      self,
      dataset,
      shuffle: bool = True,
      batch_size: int = 1,
      drop_last: bool = False,
      num_workers: Optional[int] = None,
      collate_fn: Optional[Callable] = None,
  ) -> None:
      self.dataset = dataset
      self.shuffle = shuffle
      self.batch_size = batch_size
      nb = len(self.dataset) / batch_size
      self.num_batches = math.floor(nb) if drop_last else math.ceil(nb)
      if collate_fn is None:
          self.collate_fn = (
              self.dataset.collate_fn
              if hasattr(self.dataset, "collate_fn")
              else default_collate
          )
      else:
          self.collate_fn = collate_fn
      self.num_workers = num_workers
      self.reset()
  
file_path: doctr/doctr/datasets/loader.py
imports: import math
  from typing import Callable, Optional
  import numpy
  import tensorflow
  from doctr.utils.multithreading import multithread_exec
label_desc: Use image node_id 1 to create a new DataLoader object  with example: obj = DataLoader(dataset, shuffle, batch_size, drop_last, num_workers, collate_fn)