

def test_index_lists():
    A = npr.randn(5, 6, 4)

    def fun(x):
        return to_scalar(x[[0, 1, 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_index_lists/original