def test_migrate_dropped_apex_amp_state(monkeypatch):
    """Test that the migration warns about collisions that would occur if the keys were modified."""
    monkeypatch.setattr(pl, "__version__", "2.0.0")  # pretend this version of Lightning is >= 2.0.0
    old_checkpoint = {"amp_scaling_state": {"scale": 1.23}}
    _set_version(old_checkpoint, "1.9.0")  # pretend a checkpoint prior to 2.0.0
    with pytest.warns(UserWarning, match="checkpoint contains apex AMP data"):
        updated_checkpoint, _ = migrate_checkpoint(old_checkpoint.copy())
    assert "amp_scaling_state" not in updated_checkpoint
Test that the migration warns about collisions that would occur if the keys were modified.
tests/tests_pytorch/utilities/migration/test_migration.py