class_docstr: Captures the ``nn.Module.training`` (bool) mode of every submodule, and allows it to be restored later on.
class_docstr_tok: ["Captures","the","``","nn.Module.training","``","(","bool",")","mode","of","every","submodule",",","and","allows","it","to","be","restored","later","on","."]
code: def __init__(self) -> None:
      self.mode: Dict[str, bool] = {}
  
file_path: pytorch-lightning/src/lightning/pytorch/utilities/model_helpers.py
imports: import inspect
  import logging
  import os
  from types import MethodType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Optional, Type, TypeVar
  from lightning_utilities.core.imports import RequirementCache
  from torch import nn
  from typing_extensions import Concatenate, ParamSpec
  import lightning.pytorch
label_desc: Use image node_id 1 to create a new _ModuleMode object  with example: obj = _ModuleMode()