class_docstr: All attribution algorithms extend this class. It enforces its child classes
  to extend and override core `attribute` method.
class_docstr_tok: ["All","attribution","algorithms","extend","this","class",".","It","enforces","its","child","classes","to","extend","and","override","core","`","attribute","`","method","."]
docstr: Args:
      forward_func (Callable or torch.nn.Module): This can either be an instance
                  of pytorch model or any modification of model's forward
                  function.
docstr_tok: ["Args",":","forward_func","(","Callable","or","torch.nn.Module",")",":","This","can","either","be","an","instance","of","pytorch","model","or","any","modification","of","model","'s","forward","function","."]
code: def __init__(self, forward_func: Callable) -> None:
      r"""
      Args:
          forward_func (Callable or torch.nn.Module): This can either be an instance
                      of pytorch model or any modification of model's forward
                      function.
      """
      self.forward_func = forward_func
  
imports: from typing import Any, Callable, cast, Generic, List, Tuple, Type, Union
  import torch
  import torch.nn.functional
  from captum._utils.common import _format_additional_forward_args, _format_tensor_into_tuples, _run_forward, _validate_target
  from captum._utils.gradient import compute_gradients
  from captum._utils.typing import ModuleOrModuleList, TargetType
  from captum.attr._utils.common import _format_input_baseline, _sum_rows, _tensorize_baseline, _validate_input
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 to create a new Attribution object  with example: obj = Attribution(forward_func)