code: def _reshape_and_sum(
      tensor_input: Tensor,
      num_steps: int,
      num_examples: int,
      layer_size: Tuple[int, ...],
  ) -> Tensor:
      # Used for attribution methods which perform integration
      # Sums across integration steps by reshaping tensor to
      # (num_steps, num_examples, (layer_size)) and summing over
      # dimension 0. Returns a tensor of size (num_examples, (layer_size))
      return torch.sum(
          tensor_input.reshape((num_steps, num_examples) + layer_size),
          dim=0,
      )
  
imports: import typing
  from inspect import signature
  from typing import Any, Callable, List, Tuple, TYPE_CHECKING, Union
  import torch
  from captum._utils.common import _format_baseline, _format_output, _format_tensor_into_tuples, _validate_input
  from captum._utils.typing import BaselineType, Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.approximation_methods import SUPPORTED_METHODS
  from torch import Tensor
label_desc: Use image node_id 17 for calling a global function with example usage: _reshape_and_sum(tensor_input, num_steps, num_examples, layer_size) and returns: torch