code: def _neuron_gradients(
      inputs: Union[Tensor, Tuple[Tensor, ...]],
      saved_layer: Dict[device, Tuple[Tensor, ...]],
      key_list: List[device],
      gradient_neuron_index: Union[int, Tuple[int, ...]],
  ) -> Tuple[Tensor, ...]:
      with torch.autograd.set_grad_enabled(True):
          gradient_tensors = []
          for key in key_list:
              assert (
                  len(saved_layer[key]) == 1
              ), "Cannot compute neuron gradients for layer with multiple tensors."
              current_out_tensor = saved_layer[key][0]
              gradient_tensors.append(
                  torch.autograd.grad(
                      torch.unbind(
                          _verify_select_column(
                              current_out_tensor, gradient_neuron_index
                          )
                      ),
                      inputs,
                  )
              )
          _total_gradients = _reduce_list(gradient_tensors, sum)
      return _total_gradients
  
imports: import threading
  import typing
  import warnings
  from typing import Any, Callable, Dict, List, Tuple, Union, cast
  import torch
  from torch import Tensor, device
  from torch.nn import Module
  from captum.attr._utils.batching import _reduce_list, _sort_key_list
  from captum.attr._utils.common import _run_forward, _verify_select_column
  from captum.attr._utils.typing import Literal, TargetType, TensorOrTupleOfTensorsGeneric
label_desc: Use image node_id 4 for calling a global function with example usage: _neuron_gradients(inputs, saved_layer, key_list, gradient_neuron_index) and returns: _total_gradients