class_docstr: A `TransformerTextField` is a collection of several tensors that are are a representation of text,
  tokenized and ready to become input to a transformer.
  
  The naming pattern of the tensors follows the pattern that's produced by the huggingface tokenizers,
  and expected by the huggingface transformers.
class_docstr_tok: ["A","`","TransformerTextField","`","is","a","collection","of","several","tensors","that","are","are","a","representation","of","text",",","tokenized","and","ready","to","become","input","to","a","transformer",".","The","naming","pattern","of","the","tensors","follows","the","pattern","that","'s","produced","by","the","huggingface","tokenizers",",","and","expected","by","the","huggingface","transformers","."]
code: def batch_tensors(
      self, tensor_list: List[Dict[str, torch.Tensor]]
  ) -> Dict[str, torch.Tensor]:
      result: Dict[str, torch.Tensor] = util.batch_tensor_dicts(
          tensor_list
      )
      # Transformer models need LongTensors for indices, just in case we have more than 2 billion
      # different tokens. To save space, we make the switch as late as possible, i.e., here.
      result = {
          name: t.to(torch.int64) if t.dtype == torch.int32 else t
          for name, t in result.items()
      }
      return result
  
file_path: allennlp/allennlp/data/fields/transformer_text_field.py
imports: from typing import Dict, Optional, List, Any, Union
  import torch
  import torch.nn.functional
  from allennlp.data.fields.field import Field
  from allennlp.nn import util
label_desc: Use image node_id 5 for calling the TransformerTextField obj's underlying member method code with example usage: obj.batch_tensors(tensor_list) and returns: result