code: def nonlinear(
      module: Module,
      inputs: Tensor,
      outputs: Tensor,
      grad_input: Tensor,
      grad_output: Tensor,
      eps: float = 1e-10,
  ) -> Tensor:
      r"""
      grad_input: (dLoss / dprev_layer_out, dLoss / wij, dLoss / bij)
      grad_output: (dLoss / dlayer_out)
      https://github.com/pytorch/pytorch/issues/12331
      """
      delta_in, delta_out = _compute_diffs(inputs, outputs)
  
      new_grad_inp = torch.where(
          abs(delta_in) < eps,
          grad_input,
          grad_output * delta_out / delta_in,
      )
  
      return new_grad_inp
  
imports: import typing
  import warnings
  from typing import Any, Callable, cast, List, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from captum._utils.common import _expand_additional_forward_args, _expand_target, _format_additional_forward_args, _format_baseline, _format_output, _format_tensor_into_tuples, _is_tuple, _register_backward_hook, _run_forward, _select_targets, ExpansionTypes
  from captum._utils.gradient import apply_gradient_requirements, undo_gradient_requirements
  from captum._utils.typing import BaselineType, Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.attribution import GradientAttribution
  from captum.attr._utils.common import _call_custom_attribution_func, _compute_conv_delta_and_format_attrs, _format_callable_baseline, _tensorize_baseline, _validate_input
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.hooks import RemovableHandle
label_desc: Use image node_id 1 for calling a global function with example usage: nonlinear(module, inputs, outputs, grad_input, grad_output, eps) and returns: new_grad_inp