In master, `np.linalg.svd(a)` automatically iterates over the first ndim-2 axes, so I think these reshapes and some of the ndim checks are unnecessary?