def test_array_operations_reshape(xs, ys): xs = reshape(xs, (6, )) ys = reshape(ys, (6, )) div = array_map(scalar_div, xs, ys) sm = array_reduce(scalar_add, div, ()) return array_to_scalar(sm)
def test_reshape2(x): return reshape(x, (6, ))
def test_array_to_scalar(x): return array_to_scalar(reshape(x, ()))
def test_prim_reshape(): assert reshape(np.empty((2, 3)), (6, )).shape == (6, )