def test_reshape(): array = MutableDenseNDimArray(range(50), 50) assert array.shape == (50,) assert array.rank() == 1 array = array.reshape(5, 5, 2) assert array.shape == (5, 5, 2) assert array.rank() == 3 assert len(array) == 50
def test_iterator(): array = MutableDenseNDimArray(range(4), (2, 2)) j = 0 for i in array: assert i == j j += 1 array = array.reshape(4) j = 0 for i in array: assert i == j j += 1