def linear(x1, x2):
    """
    linear kernel function
    
    Parameters
    ------------
    x1 : numpy array, (..., n)
        the first input feature vector
    x2 : numpy array, (..., n)
        the second input feature vector
    
    Returns
    ---------
    kernel : numpy array
        output kernel
    """
    return (x1*x2).sum(axis=-1)