class_docstr: A base class for creating reference (aka baseline) tensor for a sequence of
  tokens. A typical example of such token is `PAD`. Users need to provide the
  index of the reference token in the vocabulary as an argument to
  `TokenReferenceBase` class.
docstr: Generated reference tensor of given `sequence_length` using
  `reference_token_idx`.
  
  Args:
      sequence_length (int): The length of the reference sequence
      device (torch.device): The device on which the reference tensor will
                    be created.
  Returns:
  
      tensor:
      A sequence of reference token with shape:
                    [sequence_length]
docstr_tok: ["Generated","reference","tensor","of","given","`","sequence_length","`","using","`","reference_token_idx","`",".","Args",":","sequence_length","(","int",")",":","The","length","of","the","reference","sequence","device","(","torch.device",")",":","The","device","on","which","the","reference","tensor","will","be","created",".","Returns",":","tensor",":","A","sequence","of","reference","token","with","shape",":","[","sequence_length","]"]
code: def generate_reference(
      self, sequence_length, device: torch.device
  ) -> torch.Tensor:
      r"""
      Generated reference tensor of given `sequence_length` using
      `reference_token_idx`.
  
      Args:
          sequence_length (int): The length of the reference sequence
          device (torch.device): The device on which the reference tensor will
                        be created.
      Returns:
  
          tensor:
          A sequence of reference token with shape:
                        [sequence_length]
      """
      return torch.tensor(
          [self.reference_token_idx] * sequence_length, device=device
      )
  
file_path: captum/captum/attr/_models/base.py
imports: import warnings
  from functools import reduce
  import torch
  from torch.nn import Module
label_desc: Use image node_id 2 for calling the TokenReferenceBase obj's underlying member method code with example usage: obj.generate_reference(sequence_length, device) and returns: torch