def get_state_dict_float_dtype(state_dict):
    """
    Returns the first found floating dtype in `state_dict` or asserts if none were found.
    """
    for t in state_dict.values():
        if t.is_floating_point():
            return t.dtype

    raise ValueError("couldn't find any floating point dtypes in state_dict")

    Returns the first found floating dtype in `state_dict` or asserts if none were found.
    
dpkd/transformers/src/transformers/modeling_utils.py