class_docstr: A class representing a flag, which must be constant across all instances in a batch.
  This will be passed to a `forward` method as a single value of whatever type you pass in.
class_docstr_tok: ["A","class","representing","a","flag",",","which","must","be","constant","across","all","instances","in","a","batch",".","This","will","be","passed","to","a","`","forward","`","method","as","a","single","value","of","whatever","type","you","pass","in","."]
code: def as_tensor(self, padding_lengths: Dict[str, int]) -> Any:
      return self.flag_value
  
file_path: allennlp/allennlp/data/fields/flag_field.py
imports: from typing import Any, Dict, List
  from allennlp.data.fields.field import Field
label_desc: Use image node_id 3 for calling the FlagField obj's underlying member method code with example usage: obj.as_tensor(padding_lengths) and returns: self