docstr: Merge a list of samples to form a mini-batch.
  
  Args:
      samples (List[dict]): samples to collate
  
  Returns:
      dict: a mini-batch suitable for forwarding with a Model
docstr_tok: ["Merge","a","list","of","samples","to","form","a","mini-batch",".","Args",":","samples","(","List","[","dict","]",")",":","samples","to","collate","Returns",":","dict",":","a","mini-batch","suitable","for","forwarding","with","a","Model"]
code: def collater(self, samples):
      """Merge a list of samples to form a mini-batch.
  
      Args:
          samples (List[dict]): samples to collate
  
      Returns:
          dict: a mini-batch suitable for forwarding with a Model
      """
      if len(samples) == 0:
          return {}
      sample = OrderedDict()
      for k, ds in self.defn.items():
          try:
              sample[k] = ds.collater([s[k] for s in samples])
          except NotImplementedError:
              sample[k] = default_collate([s[k] for s in samples])
      return _unflatten(sample)
  
file_path: fairseq/fairseq/data/nested_dictionary_dataset.py
imports: from collections import OrderedDict
  import torch
  from torch.utils.data.dataloader import default_collate
  from .None import FairseqDataset
label_desc: Use image node_id 4 for calling the NestedDictionaryDataset obj's underlying member method code with example usage: obj.collater(samples) and returns: _unflatten, dict