Array API compatible wrapper for :py:func:`np.linalg.inv `. See its docstring for more information.
(x: Array, /)
| 133 | return Array._new(np.linalg.eigvalsh(x._array)) |
| 134 | |
| 135 | def inv(x: Array, /) -> Array: |
| 136 | """ |
| 137 | Array API compatible wrapper for :py:func:`np.linalg.inv <numpy.linalg.inv>`. |
| 138 | |
| 139 | See its docstring for more information. |
| 140 | """ |
| 141 | # Note: the restriction to floating-point dtypes only is different from |
| 142 | # np.linalg.inv. |
| 143 | if x.dtype not in _floating_dtypes: |
| 144 | raise TypeError('Only floating-point dtypes are allowed in inv') |
| 145 | |
| 146 | return Array._new(np.linalg.inv(x._array)) |
| 147 | |
| 148 | |
| 149 | # Note: matmul is the numpy top-level namespace but not in np.linalg |