Skip to content

Commit

Permalink
import lapack inside inv
Browse files Browse the repository at this point in the history
  • Loading branch information
lcskrishna committed Nov 27, 2023
1 parent d56b4bc commit 3a22ae0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cupy/linalg/_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def inv(a):
.. seealso:: :func:`numpy.linalg.inv`
"""
from cupyx import lapack
_util._assert_cupy_array(a)
_util._assert_stacked_2d(a)
_util._assert_stacked_square(a)
Expand All @@ -256,9 +257,9 @@ def inv(a):
a = a.astype(dtype, copy=True, order=order)
b = cupy.eye(a.shape[0], dtype=dtype, order=order)
if order == 'F':
cupyx.lapack.gesv(a, b)
lapack.gesv(a, b)
else:
cupyx.lapack.gesv(a.T, b.T)
lapack.gesv(a.T, b.T)
return b.astype(out_dtype, copy=False)


Expand Down

0 comments on commit 3a22ae0

Please sign in to comment.