code: def load_weights(
      mod: nn.Module, names: List[str], params: Tuple[Tensor, ...]
  ) -> None:
      """
      Reload a set of weights so that `mod` can be used again to perform a forward pass.
      Note that the `params` are regular Tensors (that can have history) and so are left
      as Tensors. This means that mod.parameters() will still be empty after this call.
      """
      for name, p in zip(names, params):
          _set_nested_attr(mod, name.split("."), p)
  
file_path: pytorch/benchmarks/functional_autograd_benchmark/utils.py
imports: from collections import defaultdict
  from typing import Callable, Dict, List, Tuple, Union
  import torch
  from torch import nn, Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: load_weights(mod, names, params) without return types