Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
def test_create_flat_names_3d():
    shape = 2, 3, 4
    assert text._create_shape(text._create_flat_names('x', shape)) == shape
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
0
def test_create_flat_names_3d():
    shape = 2, 3, 4
    assert text._create_shape(text._create_flat_names('x', shape)) == shape