예제 #1
0
def test_distribute2(v):
    return distribute(v, (3, 7))
예제 #2
0
def test_distribute4(x):
    return distribute(x, (2, 3))
예제 #3
0
def test_distribute(v, shp):
    return distribute(v, shp)
예제 #4
0
def test_distribute(x):
    return distribute(scalar_to_array(x), (2, 3))
예제 #5
0
def test_distribute2(x):
    return distribute(scalar_to_array(x), (1, ))
예제 #6
0
 def after(xs):
     return distribute(scalar_to_array(3, arr_t), shape(xs))
예제 #7
0
 def up1(x2):
     return array_map(
         scalar_add, x2,
         distribute(scalar_to_array(1, typeof(x)), shape(x)))
예제 #8
0
 def before(x):
     return distribute(x, (3, 5))
예제 #9
0
def test_prim_distribute():
    assert (distribute(1, (2, 3)) == np.ones((2, 3))).all()
예제 #10
0
 def up1(x):
     return array_map(scalar_add, x,
                      distribute(scalar_to_array(1), (2, 3)))
예제 #11
0
 def after(xs):
     return distribute(scalar_to_array(3), (3, 5))
예제 #12
0
def test_array_operations_distribute(x, y):
    xs = distribute(scalar_to_array(x), (4, 3))
    ys = distribute(scalar_to_array(y), (4, 3))
    div = array_map(scalar_div, xs, ys)
    sm = array_reduce(scalar_add, div, ())
    return array_to_scalar(sm)