docstr: The FabricModule is a thin wrapper around the :class:`torch.nn.Module` and handles precision / autocast
  automatically for the forward pass.
  
  The underlying wrapped module can be accessed via the property :attr:`module`.
  
  Args:
      forward_module: The module to wrap the ``forward`` method on.
      precision: Reference to the precision plugin for handling precision context
      original_module: The original, unmodified module as passed into the
          :meth:`lightning.fabric.fabric.Fabric.setup` method. This is needed when attribute lookup
          on this wrapper should pass through to the original module.
docstr_tok: ["The","FabricModule","is","a","thin","wrapper","around","the",":","class",":","`","torch.nn.Module","`","and","handles","precision","\/","autocast","automatically","for","the","forward","pass",".","The","underlying","wrapped","module","can","be","accessed","via","the","property",":","attr",":","`","module","`",".","Args",":","forward_module",":","The","module","to","wrap","the","``","forward","``","method","on",".","precision",":","Reference","to","the","precision","plugin","for","handling","precision","context","original_module",":","The","original",",","unmodified","module","as","passed","into","the",":","meth",":","`","lightning.fabric.fabric.Fabric.setup","`","method",".","This","is","needed","when","attribute","lookup","on","this","wrapper","should","pass","through","to","the","original","module","."]
code: def __init__(
      self,
      forward_module: nn.Module,
      precision: Precision,
      original_module: Optional[nn.Module] = None,
  ) -> None:
      """The FabricModule is a thin wrapper around the :class:`torch.nn.Module` and handles precision / autocast
      automatically for the forward pass.
  
      The underlying wrapped module can be accessed via the property :attr:`module`.
  
      Args:
          forward_module: The module to wrap the ``forward`` method on.
          precision: Reference to the precision plugin for handling precision context
          original_module: The original, unmodified module as passed into the
              :meth:`lightning.fabric.fabric.Fabric.setup` method. This is needed when attribute lookup
              on this wrapper should pass through to the original module.
  
      """
      super().__init__()
      self._forward_module = forward_module
      self._original_module = original_module or forward_module
      self._precision = precision
      self._fabric_module_initialized = True
  
imports: import inspect
  from functools import wraps
  from typing import Any, Callable, Dict, Generator, Iterator, List, Mapping, Optional, TypeVar, Union, overload
  import torch
  from lightning_utilities.core.apply_func import apply_to_collection
  from torch import Tensor
  from torch import nn
  from torch.nn.modules.module import _IncompatibleKeys
  from torch.optim import Optimizer
  from torch.utils.data import DataLoader
  from typing_extensions import override
  from lightning.fabric.plugins import Precision
  from lightning.fabric.strategies import Strategy
  from lightning.fabric.utilities import move_data_to_device
  from lightning.fabric.utilities.data import _set_sampler_epoch
  from lightning.fabric.utilities.device_dtype_mixin import _DeviceDtypeModuleMixin
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from lightning.fabric.utilities.types import Optimizable
label_desc: Use image node_id 1 to create a new _FabricModule object from inherited base classes: _DeviceDtypeModuleMixin with example: obj = _FabricModule(forward_module, precision, original_module)