ArrayFlatten[a, r] is normally equivalent to Flatten[a, {{1, r+1}, {2, r+2}, ..., {r, 2r}}].
For a tensor with rank , ArrayFlatten[a, r] gives a tensor with rank .
In ArrayFlatten[{{m11, m12, ...}, {m21, m22, ...}, ...}] all the matrices in the same row must have the same first dimension, and matrices in the same column must have the same second dimension.
In general, in ArrayFlatten[a, r], all the dimensions of must be equal for each possible value of .
Elements at level whose array depth is less than are treated as scalars, and are replicated to fill out a rank array of the appropriate dimensions.