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