def METHOD_NAME(
    state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs
):
    if prefix + "constant" in state_dict:
        constant = state_dict.pop(prefix + "constant").squeeze(-1)  # Remove deprecated singleton dimension
        state_dict[prefix + "raw_constant"] = constant
        warnings.warn(
            "You have loaded a GP model with a ConstantMean  from a previous version of "
            "GPyTorch. The mean module parameter `constant` has been renamed to `raw_constant`. "
            "Additionally, the shape of `raw_constant` is now *batch_shape, whereas the shape of "
            "`constant` was *batch_shape x 1. "
            "We have updated the name/shape of the parameter in your state dict, but we recommend that you "
            "re-save your model.",
            OldVersionWarning,
        )