code: def _unflatten_params_factory(
      param_shapes: Union[List[Tuple[int, ...]], Tuple[Tensor, ...]]
  ):
      """
      returns a function which is the inverse of `_flatten_params`
      """
  
      def _unflatten_params(flattened_params):
          params = []
          offset = 0
          for shape in param_shapes:
              length = 1
              for s in shape:
                  length *= s
              params.append(
                  flattened_params[offset : offset + length].view(shape)
              )
              offset += length
          return tuple(params)
  
      return _unflatten_params
  
imports: import warnings
  from functools import reduce
  from typing import Any, Callable, Iterable, List, NamedTuple, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.nn
  from captum._utils.common import _get_module_from_name, _parse_version
  from captum._utils.gradient import _compute_jacobian_wrt_params, _compute_jacobian_wrt_params_with_sample_wise_trick
  from captum._utils.progress import progress
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 13 for calling a global function with example usage: _unflatten_params_factory(param_shapes) and returns: _unflatten_params, tuple