class_docstr: All gradient based attribution algorithms extend this class. It requires a
  forward function, which most commonly is the forward function of the model
  that we want to interpret or the model itself.
class_docstr_tok: ["All","gradient","based","attribution","algorithms","extend","this","class",".","It","requires","a","forward","function",",","which","most","commonly","is","the","forward","function","of","the","model","that","we","want","to","interpret","or","the","model","itself","."]
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.
      """
      Attribution.__init__(self, forward_func)
      self.gradient_func = compute_gradients
  
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 GradientAttribution object from inherited base classes: Attribution with example: obj = GradientAttribution(forward_func)