

def test_len():

    def fun(x):
        assert (len(x) == 3)
        return len(x)
    A = npr.randn(3, 2)
    d_fun = (lambda x: to_scalar(grad(fun)(x)))
    check_grads(fun, A)
    check_grads(d_fun, A)

dataset/ETHPy150Open HIPS/autograd/tests/test_numpy.py test_len/original