docstr: Args:
  
      forward_func (Callable): The forward function of the model or any
                  modification of it
      layer (torch.nn.Module): Layer for which attributions are computed.
                  Output size of attribute matches this layer's input or
                  output dimensions, depending on whether we attribute to
                  the inputs or outputs of the layer, corresponding to
                  attribution of each neuron in the input or output of
                  this layer.
      device_ids (list[int]): Device ID list, necessary only if forward_func
                  applies a DataParallel model. This allows reconstruction of
                  intermediate outputs from batched results across devices.
                  If forward_func is given as the DataParallel model itself,
                  then it is not necessary to provide this argument.
      multiply_by_inputs (bool, optional): Indicates whether to factor
                  model inputs' multiplier in the final attribution scores.
                  In the literature this is also known as local vs global
                  attribution. If inputs' multiplier isn't factored in,
                  then this type of attribution method is also called local
                  attribution. If it is, then that type of attribution
                  method is called global.
                  More detailed can be found here:
                  https://arxiv.org/abs/1711.06104
  
                  In case of layer input minus baseline x gradient,
                  if `multiply_by_inputs` is set to True, the sensitivity scores
                  for scaled inputs are being multiplied by
                  layer activations for inputs - layer activations for baselines.
docstr_tok: ["Args",":","forward_func","(","Callable",")",":","The","forward","function","of","the","model","or","any","modification","of","it","layer","(","torch.nn.Module",")",":","Layer","for","which","attributions","are","computed",".","Output","size","of","attribute","matches","this","layer","'s","input","or","output","dimensions",",","depending","on","whether","we","attribute","to","the","inputs","or","outputs","of","the","layer",",","corresponding","to","attribution","of","each","neuron","in","the","input","or","output","of","this","layer",".","device_ids","(","list","[","int","]",")",":","Device","ID","list",",","necessary","only","if","forward_func","applies","a","DataParallel","model",".","This","allows","reconstruction","of","intermediate","outputs","from","batched","results","across","devices",".","If","forward_func","is","given","as","the","DataParallel","model","itself",",","then","it","is","not","necessary","to","provide","this","argument",".","multiply_by_inputs","(","bool",",","optional",")",":","Indicates","whether","to","factor","model","inputs","'","multiplier","in","the","final","attribution","scores",".","In","the","literature","this","is","also","known","as","local","vs","global","attribution",".","If","inputs","'","multiplier","is","n't","factored","in",",","then","this","type","of","attribution","method","is","also","called","local","attribution",".","If","it","is",",","then","that","type","of","attribution","method","is","called","global",".","More","detailed","can","be","found","here",":","https",":","\/\/arxiv.org\/abs\/1711.06104","In","case","of","layer","input","minus","baseline","x","gradient",",","if","`","multiply_by_inputs","`","is","set","to","True",",","the","sensitivity","scores","for","scaled","inputs","are","being","multiplied","by","layer","activations","for","inputs","-","layer","activations","for","baselines","."]
code: def __init__(
      self,
      forward_func: Callable,
      layer: Module,
      device_ids: Union[None, List[int]] = None,
      multiply_by_inputs: bool = True,
  ) -> None:
      r"""
      Args:
  
          forward_func (Callable): The forward function of the model or any
                      modification of it
          layer (torch.nn.Module): Layer for which attributions are computed.
                      Output size of attribute matches this layer's input or
                      output dimensions, depending on whether we attribute to
                      the inputs or outputs of the layer, corresponding to
                      attribution of each neuron in the input or output of
                      this layer.
          device_ids (list[int]): Device ID list, necessary only if forward_func
                      applies a DataParallel model. This allows reconstruction of
                      intermediate outputs from batched results across devices.
                      If forward_func is given as the DataParallel model itself,
                      then it is not necessary to provide this argument.
          multiply_by_inputs (bool, optional): Indicates whether to factor
                      model inputs' multiplier in the final attribution scores.
                      In the literature this is also known as local vs global
                      attribution. If inputs' multiplier isn't factored in,
                      then this type of attribution method is also called local
                      attribution. If it is, then that type of attribution
                      method is called global.
                      More detailed can be found here:
                      https://arxiv.org/abs/1711.06104
  
                      In case of layer input minus baseline x gradient,
                      if `multiply_by_inputs` is set to True, the sensitivity scores
                      for scaled inputs are being multiplied by
                      layer activations for inputs - layer activations for baselines.
  
      """
      LayerAttribution.__init__(self, forward_func, layer, device_ids)
      GradientAttribution.__init__(self, forward_func)
      self._multiply_by_inputs = multiply_by_inputs
  
imports: import typing
  from typing import Any, Callable, cast, List, Tuple, Union
  import numpy
  import torch
  from captum._utils.gradient import _forward_layer_eval, compute_layer_gradients_and_eval
  from captum._utils.typing import Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._core.gradient_shap import _scale_input
  from captum.attr._core.noise_tunnel import NoiseTunnel
  from captum.attr._utils.attribution import GradientAttribution, LayerAttribution
  from captum.attr._utils.common import _compute_conv_delta_and_format_attrs, _format_callable_baseline, _format_input_baseline
  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 LayerInputBaselineXGradient object from inherited base classes: LayerAttribution, GradientAttribution with example: obj = LayerInputBaselineXGradient(forward_func, layer, device_ids, multiply_by_inputs)