class_docstr: This class is similar with `DataCollator` in [Transformers]
  (https://github.com/huggingface/transformers/blob/master/src/transformers/data/data_collator.py)
  Allow to do some dynamic operations for tensor in different batches
  Cause this method run before each epoch to convert `List[Instance]` to `TensorDict`
class_docstr_tok: ["This","class","is","similar","with","`","DataCollator","`","in","[","Transformers","]","(","https",":","\/\/github.com\/huggingface\/transformers\/blob\/master\/src\/transformers\/data\/data_collator.py",")","Allow","to","do","some","dynamic","operations","for","tensor","in","different","batches","Cause","this","method","run","before","each","epoch","to","convert","`","List","[","Instance","]","`","to","`","TensorDict","`"]
code: def __call__(self, instances: List[Instance]) -> TensorDict:
      raise NotImplementedError
  
file_path: allennlp/allennlp/data/data_loaders/data_collator.py
imports: from typing import List
  from transformers.data.data_collator import DataCollatorForLanguageModeling
  from allennlp.common import Registrable
  from allennlp.data.batch import Batch
  from allennlp.data.data_loaders.data_loader import TensorDict
  from allennlp.data.instance import Instance
label_desc: Use image node_id 1 for calling the DataCollator obj's underlying member method code with example usage: obj.__call__(instances) without return types