For a tensor with rank 2r, ArrayFlatten gives a tensor with rank r.
In ArrayFlatten 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, all the k dimensions of must be equal for each possible value of .
Elements at level r whose array depth is less than r are treated as scalars, and are replicated to fill out a rank r array of the appropriate dimensions.