As of version 1.8, several of the routines in np.linalg can operate on a 'stack' of matrices. That is, the routine can calculate results for multiple matrices if they're stacked together. For example, A here is interpreted as two stacked 3-by-3 matrices:
np.random.seed(123)
A = np.random.rand(2,...