def test_save_hparams_to_yaml_warning(tmp_path):
    """Test that we warn about unserializable parameters that need to be dropped."""
    path_yaml = tmp_path / "hparams.yaml"
    hparams = {"torch_type": torch.float32}
    with pytest.warns(UserWarning, match="Skipping 'torch_type' parameter"):
        save_hparams_to_yaml(path_yaml, hparams)
Test that we warn about unserializable parameters that need to be dropped.
tests/tests_pytorch/models/test_hparams.py