Transpose each matrix in a stack of matrices. Unlike np.transpose, this only swaps the last two axes, rather than all of them Parameters ---------- a : (...,M,N) array_like Returns ------- aT : (...,N,M) ndarray
(a)
| 268 | |
| 269 | |
| 270 | def transpose(a): |
| 271 | """ |
| 272 | Transpose each matrix in a stack of matrices. |
| 273 | |
| 274 | Unlike np.transpose, this only swaps the last two axes, rather than all of |
| 275 | them |
| 276 | |
| 277 | Parameters |
| 278 | ---------- |
| 279 | a : (...,M,N) array_like |
| 280 | |
| 281 | Returns |
| 282 | ------- |
| 283 | aT : (...,N,M) ndarray |
| 284 | """ |
| 285 | return swapaxes(a, -1, -2) |
| 286 | |
| 287 | # Linear equations |
| 288 |
searching dependent graphs…