class_docstr: Wrap multiple collate functions together and apply it to merge inputs from a dict.
  
  The generated batch samples are stored as a dict with the same keywords.
  
  Each data sample should be a dict and the fn corresponds to `key` will be applied on the
  input with the keyword `key`.
  For example, each data sample is {'data': nd_data, 'label': nd_label}.
  You can merge the data and labels using
  `Dict({'data': DataCollate, 'label': LabelCollate})` to collate the nd_data and nd_label.
  
  Parameters
  ----------
      fn_dict (dict): A dictionary that contains the key-->collate function mapping.
class_docstr_tok: ["Wrap","multiple","collate","functions","together","and","apply","it","to","merge","inputs","from","a","dict",".","The","generated","batch","samples","are","stored","as","a","dict","with","the","same","keywords",".","Each","data","sample","should","be","a","dict","and","the","fn","corresponds","to","`","key","`","will","be","applied","on","the","input","with","the","keyword","`","key","`",".","For","example",",","each","data","sample","is","{","'data","'",":","nd_data",",","'label","'",":","nd_label","}",".","You","can","merge","the","data","and","labels","using","`","Dict","(","{","'data","'",":","DataCollate",",","'label","'",":","LabelCollate","}",")","`","to","collate","the","nd_data","and","nd_label",".","Parameters","--","--","--","--","--","fn_dict","(","dict",")",":","A","dictionary","that","contains","the","key","--",">","collate","function","mapping","."]
code: def __init__(self, fn_dict):
      self._fn_dict = fn_dict
      if not isinstance(fn_dict, dict):
          raise ValueError(
              f"Input must be a dictionary! type of input={type(fn_dict)}"
          )
      for fn in fn_dict.values():
          if not hasattr(fn, "__call__"):
              raise ValueError(
                  "Elements of the dictionary must be callable!"
              )
      self._fn_dict = fn_dict
  
file_path: autogluon/multimodal/src/autogluon/multimodal/data/collator.py
imports: import math
  import warnings
  import numpy
  import torch
label_desc: Use image node_id 1 to create a new DictCollator object  with example: obj = DictCollator(fn_dict)