MCPcopy Create free account
hub / github.com/numpy/numpy / matrix_transpose

Function matrix_transpose

numpy/array_api/linalg.py:223–226  ·  view source on GitHub ↗
(x: Array, /)

Source from the content-addressed store, hash-verified

221# Note: this function is new in the array API spec. Unlike transpose, it only
222# transposes the last two axes.
223def matrix_transpose(x: Array, /) -> Array:
224 if x.ndim < 2:
225 raise ValueError("x must be at least 2-dimensional for matrix_transpose")
226 return Array._new(np.swapaxes(x._array, -1, -2))
227
228# Note: outer is the numpy top-level namespace, not np.linalg
229def outer(x1: Array, x2: Array, /) -> Array:

Callers 1

mTMethod · 0.85

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected