class_docstr: TextTokenInput is an implementation of InterpretableInput for text inputs, whose
  interpretable features are the tokens of the text with respect to a given tokenizer.
  It is initiated with the string form of the input text and the corresponding
  tokenizer. Its input format to the model will be the tokenized id tensor,
  while its interpretable representation will be a binary tensor of the tokens
  whose values indicates if the token is “presence” or “absence”.
  
  Args:
  
      text (str): text string for the model
      tokenizer (Tokenizer): tokenizer of the language model
      baselines (int or str, optional): the
              baseline value for the tokens. It can be a string of the baseline token
              or an integer of the baseline token id. Common choices include unknown
              token or padding token. The default value is 0, which
              is commonly used for unknown token.
              Default: 0
      skip_tokens (List[int] or List[str], optional): the tokens to skip in the
              the input's interpretable representation. Use this argument to define
              uninterested tokens, commonly like special tokens, e.g., sos, and unk.
              It can be a list of strings of the tokens or a list of integers of the
              token ids.
              Default: None
  
  Examples::
  
      >>> text_inp = TextTokenInput("This is a test.", tokenizer)
      >>>
      >>> text_inp.to_tensor()
      >>> # the shape dependens on the tokenizer
      >>> # assuming it is broken into ["<s>", "This", "is", "a", "test", "."],
      >>> # torch.tensor([[1, 6]])
      >>>
      >>> text_inp.to_model_input(torch.tensor([[0, 1]]))
      >>> # torch.tensor([[1, 6]])
class_docstr_tok: ["TextTokenInput","is","an","implementation","of","InterpretableInput","for","text","inputs",",","whose","interpretable","features","are","the","tokens","of","the","text","with","respect","to","a","given","tokenizer",".","It","is","initiated","with","the","string","form","of","the","input","text","and","the","corresponding","tokenizer",".","Its","input","format","to","the","model","will","be","the","tokenized","id","tensor",",","while","its","interpretable","representation","will","be","a","binary","tensor","of","the","tokens","whose","values","indicates","if","the","token","is","\u201c","presence","\u201d","or","\u201c","absence","\u201d",".","Args",":","text","(","str",")",":","text","string","for","the","model","tokenizer","(","Tokenizer",")",":","tokenizer","of","the","language","model","baselines","(","int","or","str",",","optional",")",":","the","baseline","value","for","the","tokens",".","It","can","be","a","string","of","the","baseline","token","or","an","integer","of","the","baseline","token","id",".","Common","choices","include","unknown","token","or","padding","token",".","The","default","value","is","0",",","which","is","commonly","used","for","unknown","token",".","Default",":","0","skip_tokens","(","List","[","int","]","or","List","[","str","]",",","optional",")",":","the","tokens","to","skip","in","the","the","input","'s","interpretable","representation",".","Use","this","argument","to","define","uninterested","tokens",",","commonly","like","special","tokens",",","e.g.",",","sos",",","and","unk",".","It","can","be","a","list","of","strings","of","the","tokens","or","a","list","of","integers","of","the","token","ids",".","Default",":","None","Examples",":",":",">",">",">","text_inp","=","TextTokenInput","(","``","This","is","a","test",".","``",",","tokenizer",")",">",">",">",">",">",">","text_inp.to_tensor","(",")",">",">",">","#","the","shape","dependens","on","the","tokenizer",">",">",">","#","assuming","it","is","broken","into","[","``","<","s",">","''",",","``","This","''",",","``","is","''",",","``","a","''",",","``","test","''",",","``",".","``","]",",",">",">",">","#","torch.tensor","(","[","[","1",",","6","]","]",")",">",">",">",">",">",">","text_inp.to_model_input","(","torch.tensor","(","[","[","0",",","1","]","]",")",")",">",">",">","#","torch.tensor","(","[","[","1",",","6","]","]",")"]
code: def format_attr(self, itp_attr: torch.Tensor):
      return itp_attr
  
file_path: captum/captum/attr/_utils/interpretable_input.py
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import Tensor
label_desc: Use image node_id 4 for calling the TextTokenInput obj's underlying member method code with example usage: obj.format_attr(itp_attr) and returns: itp_attr