Пример #1
0
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)
Пример #2
0
def test_reshape2(x):
    return reshape(x, (6, ))
Пример #3
0
def test_array_to_scalar(x):
    return array_to_scalar(reshape(x, ()))
Пример #4
0
def test_prim_reshape():
    assert reshape(np.empty((2, 3)), (6, )).shape == (6, )