示例#1
0
def test_1D_arr_just_right():
    N = 8
    mem_limit = 100
    d = 3
    out = get_homogeneous_block_shape((N,), (d,),
            mem_limit=mem_limit)
    assert out == (N,)
示例#2
0
def test_1D_arr_too_large():
    N = 9
    mem_limit = 100
    d = 3
    out = get_homogeneous_block_shape((N,), (d,),
            mem_limit=mem_limit)
    assert out == (8,)
示例#3
0
def test_1D_arr_small_enough():
    N = 6
    mem_limit = 100
    d = 3
    out = get_homogeneous_block_shape((N,), (d,),
            mem_limit=mem_limit)
    assert out == (N,)
示例#4
0
def test_1D_arr_unit_filter():
    N = 15
    mem_limit = 15
    itemsize = 1
    d = 1
    out = get_homogeneous_block_shape((N,), (d,),
            mem_limit=mem_limit, itemsize=itemsize)
    assert out == (N,)
示例#5
0
def test_2D_arr():
    N, M = 8, 8
    f = 13
    arr_shape = (N, M)
    filter_shape = (f,)
    d1, d2 = 2, 2
    mem_limit = 4 * d1 * d2 * f
    out = get_homogeneous_block_shape(arr_shape,
                                      filter_shape,
            mem_limit=mem_limit)
    assert out == (d1, d2)