<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_int(val):
 r"""Check if input value is an int or a np.ndarray of ints, if not convert. Parameters val : any Input value Returns ------- int or np.ndarray of ints 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, float):
        val = int(val)
    elif isinstance(val, (list, tuple)):
        val = np.array(val, dtype=int)
    elif isinstance(val, np.ndarray) and (not np.issubdtype(val.dtype,
                                                            np.integer)):
        val = val.astype(int)

    return val