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

Function inv

numpy/array_api/linalg.py:135–146  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.linalg.inv `. See its docstring for more information.

(x: Array, /)

Source from the content-addressed store, hash-verified

133 return Array._new(np.linalg.eigvalsh(x._array))
134
135def 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

Callers

nothing calls this directly

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected