def test_prim_reshape(): assert reshape(np.empty((2, 3)), (6, )).shape == (6, )
def test_reshape(v, shp): return reshape(v, shp)
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_reshape4(x): return reshape(x, ())
def test_reshape3(x): return reshape(x, (3, ))
def test_reshape2(x): return reshape(x, (6, ))
def test_reshape(x): return reshape(x, (1, 3, 2, 1))