code: def _reset_module_training_mode(
      modules: Dict[str, nn.Module], prior_modes: Dict[str, bool]
  ) -> None:
      # Reset training mode for modules at the end of the epoch
      # This ensures that side-effects made by the loop are reset before
      # returning back to the user
      for name, module in modules.items():
          if name in prior_modes:
              module.train(prior_modes[name])
  
file_path: tnt/torchtnt/framework/_loop_utils.py
imports: import collections
  import inspect
  import logging
  from typing import Callable, Dict, Iterable, Optional, TypeVar
  import torch
  import torch.nn
  import typing_extensions
  from torchtnt.framework.state import State
  from torchtnt.utils.progress import Progress
label_desc: Use image node_id 5 for calling a global function with example usage: _reset_module_training_mode(modules, prior_modes) without return types