human
Complete the below
def gradcheck(func, inputs, eps=1e-06, atol=1e-05, rtol=0.001):

    ''''Check gradients computed via small finite differences
    against analytical gradients
    The check between numerical and analytical has the same behaviour as
    numpy.allclose https://docs.scipy.org/doc/numpy/reference/generated/numpy.allclose.html
    meaning it check that
    absolute(a - n) <= (atol + rtol * absolute(n))
    is true for all elements of analytical jacobian a and numerical jacobian n.
    Args:
    func: Python function that takes Variable inputs and returns
    a tuple of Variables
    inputs: tuple of Variables
    eps: perturbation for finite differences
    atol: absolute tolerance
    rtol: relative tolerance
    Returns:
    True if all differences satisfy allclose condition'
    '''

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    output = func(*inputs)
    output = _as_tuple(output)
    for (i, o) in enumerate(output):
        if (not o.requires_grad):
            continue
        def fn(input):
            return _as_tuple(func(*input))[i].data
        (analytical, reentrant, correct_grad_sizes) = get_analytical_jacobian(_as_tuple(inputs), o)
        numerical = get_numerical_jacobian(fn, inputs, inputs, eps)
        for (a, n) in zip(analytical, numerical):
            if (not ((a - n).abs() <= (atol + (rtol * n.abs()))).all()):
                return False
        if (not reentrant):
            return False
        if (not correct_grad_sizes):
            return False
    zero_gradients(inputs)
    output = _as_tuple(func(*inputs))
    torch.autograd.backward(output, [o.data.new(o.size()).zero_() for o in output])
    var_inputs = list(filter((lambda i: isinstance(i, Variable)), inputs))
    if (not var_inputs):
        raise RuntimeError('no    Variables    found    in    input')
    for i in var_inputs:
        if (i.grad is None):
            continue
        if (not i.grad.data.eq(0).all()):
            return False
    return True