class_docstr: Computes conductance with respect to the given layer. The
  returned output is in the shape of the layer's output, showing the total
  conductance of each hidden layer neuron.
  
  The details of the approach can be found here:
  https://arxiv.org/abs/1805.12233
  https://arxiv.org/abs/1807.09946
  
  Note that this provides the total conductance of each neuron in the
  layer's output. To obtain the breakdown of a neuron's conductance by input
  features, utilize NeuronConductance instead, and provide the target
  neuron index.
code: def _attribute(
      self,
      inputs: Tuple[Tensor, ...],
      baselines: Tuple[Union[Tensor, int, float], ...],
      target: TargetType = None,
      additional_forward_args: Any = None,
      n_steps: int = 50,
      method: str = "gausslegendre",
      attribute_to_layer_input: bool = False,
      step_sizes_and_alphas: Union[
          None, Tuple[List[float], List[float]]
      ] = None,
  ) -> Union[Tensor, Tuple[Tensor, ...]]:
      num_examples = inputs[0].shape[0]
      if step_sizes_and_alphas is None:
          # Retrieve scaling factors for specified approximation method
          step_sizes_func, alphas_func = approximation_parameters(
              method
          )
          alphas = alphas_func(n_steps + 1)
      else:
          _, alphas = step_sizes_and_alphas
      # Compute scaled inputs from baseline to final input.
      scaled_features_tpl = tuple(
          torch.cat(
              [
                  baseline + alpha * (input - baseline)
                  for alpha in alphas
              ],
              dim=0,
          ).requires_grad_()
          for input, baseline in zip(inputs, baselines)
      )
  
      additional_forward_args = _format_additional_forward_args(
          additional_forward_args
      )
      # apply number of steps to additional forward args
      # currently, number of steps is applied only to additional forward arguments
      # that are nd-tensors. It is assumed that the first dimension is
      # the number of batches.
      # dim -> (#examples * #steps x additional_forward_args[0].shape[1:], ...)
      input_additional_args = (
          _expand_additional_forward_args(
              additional_forward_args, n_steps + 1
          )
          if additional_forward_args is not None
          else None
      )
      expanded_target = _expand_target(target, n_steps + 1)
  
      # Conductance Gradients - Returns gradient of output with respect to
      # hidden layer and hidden layer evaluated at each input.
      (
          layer_gradients,
          layer_evals,
      ) = compute_layer_gradients_and_eval(
          forward_fn=self.forward_func,
          layer=self.layer,
          inputs=scaled_features_tpl,
          additional_forward_args=input_additional_args,
          target_ind=expanded_target,
          device_ids=self.device_ids,
          attribute_to_layer_input=attribute_to_layer_input,
      )
  
      # Compute differences between consecutive evaluations of layer_eval.
      # This approximates the total input gradient of each step multiplied
      # by the step size.
      grad_diffs = tuple(
          layer_eval[num_examples:] - layer_eval[:-num_examples]
          for layer_eval in layer_evals
      )
  
      # Element-wise multiply gradient of output with respect to hidden layer
      # and summed gradients with respect to input (chain rule) and sum
      # across stepped inputs.
      attributions = tuple(
          _reshape_and_sum(
              grad_diff * layer_gradient[:-num_examples],
              n_steps,
              num_examples,
              layer_eval.shape[1:],
          )
          for layer_gradient, layer_eval, grad_diff in zip(
              layer_gradients, layer_evals, grad_diffs
          )
      )
      return _format_output(len(attributions) > 1, attributions)
  
imports: import typing
  from typing import Any, Callable, List, Tuple, Union
  import torch
  from captum._utils.common import _expand_additional_forward_args, _expand_target, _format_additional_forward_args, _format_output
  from captum._utils.gradient import compute_layer_gradients_and_eval
  from captum._utils.typing import BaselineType, Literal, TargetType
  from captum.attr._utils.approximation_methods import approximation_parameters
  from captum.attr._utils.attribution import GradientAttribution, LayerAttribution
  from captum.attr._utils.batching import _batch_attribution
  from captum.attr._utils.common import _format_input_baseline, _reshape_and_sum, _validate_input
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 6 for calling the LayerConductance obj's underlying member method code with example usage: obj._attribute(inputs, baselines, target, additional_forward_args, n_steps, method, attribute_to_layer_input, step_sizes_and_alphas) and returns: _format_output