code: def _compute_diffs(
      inputs: Tensor, outputs: Tensor
  ) -> Tuple[Tensor, Tensor]:
      input, input_ref = inputs.chunk(2)
      # if the model is a single non-linear module and we apply Rescale rule on it
      # we might not be able to perform chunk-ing because the output of the module is
      # usually being replaced by model output.
      output, output_ref = outputs.chunk(2)
      delta_in = input - input_ref
      delta_out = output - output_ref
  
      return torch.cat(2 * [delta_in]), torch.cat(2 * [delta_out])
  
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 7 for calling a global function with example usage: _compute_diffs(inputs, outputs) and returns: torch,  torch