Computing Inverse of a stack of matrices

I see, Thanks for pointing this out! But, in general, say if I wanted the array to be shaped 1000x4x3x3 instead of 4000x3x3 for further calculations downstream would flattening and reshaping it back be worth considering the performance ?