human
Complete the below
def check_grad(loss, x0, y0, seed=1, eps=None, rtol=None, atol=None):

    ''''Numerical gradient checking of loss functions.'
    '''

Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def fun(x):
        ca.random.seed(seed)
        y = np.array(loss.loss(ca.array(x), ca.array(y0))).astype(np.float_)
        return np.sum(y)
    def fun_grad(x):
        x_grad = np.array(loss.grad(ca.array(x), ca.array(y0)))
        return x_grad
    g_approx = approx_fprime(x0, fun, eps)
    g_true = fun_grad(x0)
    assert gradclose(g_true, g_approx, rtol, atol)