code: def default_collate(samples):
      """Collate multiple elements into batches
  
      Args:
      ----
          samples: list of N tuples containing M elements
  
      Returns:
      -------
          Tuple of M sequences contianing N elements each
      """
      batch_data = zip(*samples)
  
      tf_data = tuple(tf.stack(elt, axis=0) for elt in batch_data)
  
      return tf_data
  
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 for calling a global function with example usage: default_collate(samples) and returns: tf_data