def _transpose_vectorized(M):
 ndim = M.ndim
 assert (ndim == 3)
 return np.transpose(M, [0, (ndim - 1), (ndim - 2)])

def _transpose_vectorized ( M ) : ndim = M . ndim assert ( ndim == 3 ) return np . transpose ( M , [ 0 , ( ndim - 1 ) , ( ndim - 2 ) ] )
transposition of an array of matrices *m* .