<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_float(val):
 r"""Check if input value is a float or a np.ndarray of floats, if not convert. Parameters val : any Input value Returns ------- float or np.ndarray of floats Examples -------- array([0, 1, 2, 3, 4]) array([ 0., 1., 2., 3., 4.]) """


    if not isinstance(val, (int, float, list, tuple, np.ndarray)):
        raise TypeError('Invalid input type.')
    if isinstance(val, int):
        val = float(val)
    elif isinstance(val, (list, tuple)):
        val = np.array(val, dtype=float)
    elif isinstance(val, np.ndarray) and (not np.issubdtype(val.dtype,
                                                            np.floating)):
        val = val.astype(float)

    return val