Array API compatible wrapper for :py:func:`np.linalg.eigvalsh `. See its docstring for more information.
(x: Array, /)
| 120 | |
| 121 | |
| 122 | def eigvalsh(x: Array, /) -> Array: |
| 123 | """ |
| 124 | Array API compatible wrapper for :py:func:`np.linalg.eigvalsh <numpy.linalg.eigvalsh>`. |
| 125 | |
| 126 | See its docstring for more information. |
| 127 | """ |
| 128 | # Note: the restriction to floating-point dtypes only is different from |
| 129 | # np.linalg.eigvalsh. |
| 130 | if x.dtype not in _floating_dtypes: |
| 131 | raise TypeError('Only floating-point dtypes are allowed in eigvalsh') |
| 132 | |
| 133 | return Array._new(np.linalg.eigvalsh(x._array)) |
| 134 | |
| 135 | def inv(x: Array, /) -> Array: |
| 136 | """ |