示例#1
0
def test_transpose2(x, y, axis1, axis2):
    perm = (scalar_cast(axis1, u64), scalar_cast(axis2, u64))
    xt = transpose(x, perm)
    yt = transpose(y, perm)
    d = dot(xt, yt)
    sm = array_reduce(scalar_add, d, ())
    return array_to_scalar(sm)
示例#2
0
def test_transpose(v, perm):
    return transpose(v, perm)
示例#3
0
def test_transpose(x):
    return transpose(x, (1, 0))
示例#4
0
 def before3(x):
     return transpose(x, (1, 0))
示例#5
0
 def before2(x):
     x = transpose(x, (1, 0))
     x = transpose(x, (1, 0))
     return x
示例#6
0
 def before1(x):
     return transpose(x, (0, 1))
示例#7
0
def test_prim_transpose():
    assert transpose(np.empty((2, 3)), (1, 0)).shape == (3, 2)
    assert transpose(np.empty((2, 3, 4)), (2, 0, 1)).shape == (4, 2, 3)
示例#8
0
def test_transpose(x, y):
    xt = transpose(x, (1, 0))
    yt = transpose(y, (1, 0))
    d = dot(xt, yt)
    sm = array_reduce(scalar_add, d, ())
    return array_to_scalar(sm)