The lower forms on this list are more explicit and allow you to increase the asymmetry in your block forms.
Examples
We will discuss this using a sequence of chunks examples in the following array:
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
Let's show how different chunks arguments break an array into different blocks
chunks=3
Symmetric size 3 blocks
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
chunks=2
Symmetric size 2 blocks
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
chunks=(3, 2)
Asymmetric, but repeating size blocks (3, 2)
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
chunks=(1, 6)
Asymmetric, but repeating size blocks (1, 6)
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
chunks=((2, 4), (3, 3))
Asymmetric and non-repeating blocks
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
chunks=((2, 2, 1, 1), (3, 2, 1))
Asymmetric and non-repeating blocks
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
Discussion
The latest examples are rarely provided by users from the source data, but arise from complex slicing and broadcasting operations. I usually use the simplest form until I need more complex forms. The choice of pieces should match the calculations you want to do.
For example, if you plan to take out thin slices along the first dimension, you might want to make this dimension narrower than others. If you plan to do linear algebra, then you may need more symmetrical blocks.
Mocklin
source share