class_docstr: Neuron attribution provides input attribution for a given neuron, quantifying
  the importance of each input feature in the activation of a particular neuron.
  Calling attribute on a NeuronAttribution object requires also providing
  the index of the neuron in the output of the given layer for which attributions
  are required.
  The output attribution of calling attribute on a NeuronAttribution object
  always matches the size of the input.
class_docstr_tok: ["Neuron","attribution","provides","input","attribution","for","a","given","neuron",",","quantifying","the","importance","of","each","input","feature","in","the","activation","of","a","particular","neuron",".","Calling","attribute","on","a","NeuronAttribution","object","requires","also","providing","the","index","of","the","neuron","in","the","output","of","the","given","layer","for","which","attributions","are","required",".","The","output","attribution","of","calling","attribute","on","a","NeuronAttribution","object","always","matches","the","size","of","the","input","."]
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.
      layer (torch.nn.Module): Layer for which output attributions are computed.
                  Output size of attribute matches that of layer output.
      device_ids (list[int]): Device ID list, necessary only if forward_func
                  applies a DataParallel model, which 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.
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",".","layer","(","torch.nn.Module",")",":","Layer","for","which","output","attributions","are","computed",".","Output","size","of","attribute","matches","that","of","layer","output",".","device_ids","(","list","[","int","]",")",":","Device","ID","list",",","necessary","only","if","forward_func","applies","a","DataParallel","model",",","which","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","."]
code: def __init__(
      self,
      forward_func: Callable,
      layer: Module,
      device_ids: Union[None, List[int]] = None,
  ) -> 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.
          layer (torch.nn.Module): Layer for which output attributions are computed.
                      Output size of attribute matches that of layer output.
          device_ids (list[int]): Device ID list, necessary only if forward_func
                      applies a DataParallel model, which 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.
      """
      InternalAttribution.__init__(
          self, forward_func, layer, device_ids
      )
  
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 NeuronAttribution object from inherited base classes: InternalAttribution with example: obj = NeuronAttribution(forward_func, layer, device_ids)