code: def _drop_apex_amp_state(checkpoint: _CHECKPOINT) -> _CHECKPOINT:
      """Apex support was removed in v2.0.0, and this migration drops it from the state-keys saved in the checkpoint
      dict.
  
      Version: 2.0.0
      Commit: e544676ff434ed96c6dd3b4e73a708bcb27ebcf1
      PR: #16149
  
      """
      key = "amp_scaling_state"
      if key in checkpoint:
          rank_zero_warn(
              "This checkpoint contains apex AMP data, but apex support has been removed in v2.0.0."
          )
          del checkpoint[key]
      return checkpoint
  
file_path: pytorch-lightning/src/lightning/pytorch/utilities/migration/migration.py
imports: import re
  from typing import Any, Callable, Dict, List
  from lightning.fabric.utilities.warnings import PossibleUserWarning
  from lightning.pytorch.callbacks.early_stopping import EarlyStopping
  from lightning.pytorch.callbacks.model_checkpoint import ModelCheckpoint
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 8 for calling a global function with example usage: _drop_apex_amp_state(checkpoint) and returns: checkpoint