class_docstr: A ``Field`` is some piece of a data instance that ends up as an tensor in a model (either as an
  input or an output).  Data instances are just collections of fields.
  
  Fields go through up to two steps of processing: (1) tokenized fields are converted into token
  ids, (2) fields containing token ids (or any other numeric data) are padded (if necessary) and
  converted into tensors.  The ``Field`` API has methods around both of these steps, though they
  may not be needed for some concrete ``Field`` classes - if your field doesn't have any strings
  that need indexing, you don't need to implement ``count_vocab_items`` or ``index``.  These
  methods ``pass`` by default.
  
  Once a vocabulary is computed and all fields are indexed, we will determine padding lengths,
  then intelligently batch together instances and pad them into actual tensors.
docstr: If there are things in this field that need padding, note them here.  In order to pad a
  batch of instance, we get all of the lengths from the batch, take the max, and pad
  everything to that length (or use a pre-specified maximum length).  The return value is a
  dictionary mapping keys to lengths, like {'num_tokens': 13}.
  
  This is always called after :func:`index`.
docstr_tok: ["If","there","are","things","in","this","field","that","need","padding",",","note","them","here",".","In","order","to","pad","a","batch","of","instance",",","we","get","all","of","the","lengths","from","the","batch",",","take","the","max",",","and","pad","everything","to","that","length","(","or","use","a","pre-specified","maximum","length",")",".","The","return","value","is","a","dictionary","mapping","keys","to","lengths",",","like","{","'num_tokens","'",":","13","}",".","This","is","always","called","after",":","func",":","`","index","`","."]
code: def get_padding_lengths(self):
      """
      If there are things in this field that need padding, note them here.  In order to pad a
      batch of instance, we get all of the lengths from the batch, take the max, and pad
      everything to that length (or use a pre-specified maximum length).  The return value is a
      dictionary mapping keys to lengths, like {'num_tokens': 13}.
  
      This is always called after :func:`index`.
      """
      raise NotImplementedError
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/fields/field.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.data.vocabulary import Vocabulary
label_desc: Use image node_id 3 for calling the Field obj's underlying member method code with example usage: obj.get_padding_lengths() without return types