def test_array_from_arrays_2():
    def fun(x):
        return to_scalar(np.array([[2*x, x + 1],
                                   [x  ,     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_array_from_arrays_2/original