示例#1
0
def test_create_flat_names_2d():
    shape = 2, 3
    result = text._create_flat_names('x', shape)
    expected = ['x__0_0', 'x__0_1', 'x__0_2',
                'x__1_0', 'x__1_1', 'x__1_2']
    assert result == expected
    assert text._create_shape(result) == shape
示例#2
0
def test_create_flat_names_0d():
    shape = ()
    result = text._create_flat_names('x', shape)
    expected = ['x']
    assert result == expected
    assert text._create_shape(result) == shape
示例#3
0
def test_create_flat_names_3d():
    shape = 2, 3, 4
    assert text._create_shape(text._create_flat_names('x', shape)) == shape
示例#4
0
def test_create_flat_names_2d():
    shape = 2, 3
    result = text._create_flat_names('x', shape)
    expected = ['x__0_0', 'x__0_1', 'x__0_2', 'x__1_0', 'x__1_1', 'x__1_2']
    assert result == expected
    assert text._create_shape(result) == shape
示例#5
0
def test_create_flat_names_0d():
    shape = ()
    result = text._create_flat_names('x', shape)
    expected = ['x']
    assert result == expected
    assert text._create_shape(result) == shape
示例#6
0
def test_create_flat_names_3d():
    shape = 2, 3, 4
    assert text._create_shape(text._create_flat_names('x', shape)) == shape