()
| 535 | |
| 536 | |
| 537 | def test_reshape_initializer_list(): |
| 538 | a = np.arange(2 * 7 * 3) + 1 |
| 539 | x = m.reshape_initializer_list(a, 2, 7, 3) |
| 540 | assert x.shape == (2, 7, 3) |
| 541 | assert list(x[1][4]) == [34, 35, 36] |
| 542 | with pytest.raises(ValueError) as excinfo: |
| 543 | m.reshape_initializer_list(a, 1, 7, 3) |
| 544 | assert str(excinfo.value) == "cannot reshape array of size 42 into shape (1,7,3)" |
| 545 | |
| 546 | |
| 547 | def test_reshape_tuple(): |