class_docstr: Plugin for Automatic Mixed Precision (AMP) training with ``torch.autocast``.
  
  Args:
      precision: Whether to use ``torch.float16`` (``'16-mixed'``) or ``torch.bfloat16`` (``'bf16-mixed'``).
      device: The device for ``torch.autocast``.
      scaler: An optional :class:`torch.cuda.amp.GradScaler` to use.
code: def convert_output(self, data: Any) -> Any:
      return apply_to_collection(
          data,
          function=_convert_fp_tensor,
          dtype=Tensor,
          dst_type=torch.get_default_dtype(),
      )
  
imports: from typing import Any, ContextManager, Dict, Literal, Optional
  import torch
  from lightning_utilities.core.apply_func import apply_to_collection
  from torch import Tensor
  from torch.nn import Module
  from torch.optim import LBFGS, Optimizer
  from typing_extensions import override
  from lightning.fabric.accelerators.cuda import _patch_cuda_is_available
  from lightning.fabric.plugins.precision.precision import Precision
  from lightning.fabric.plugins.precision.utils import _convert_fp_tensor
  from lightning.fabric.utilities.types import Optimizable
label_desc: Use image node_id 4 for calling the MixedPrecision obj's underlying member method code with example usage: obj.convert_output(data) and returns: apply_to_collection