We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5b6680 commit 9b53570Copy full SHA for 9b53570
array_api_strict/linalg.py
@@ -305,10 +305,16 @@ def slogdet(x: Array, /) -> SlogdetResult:
305
# To workaround this, the below is the code from np.linalg.solve except
306
# only calling solve1 in the exactly 1D case.
307
def _solve(a, b):
308
- from numpy.linalg._linalg import (
+ try:
309
+ from numpy.linalg._linalg import (
310
_makearray, _assert_stacked_2d, _assert_stacked_square,
311
_commonType, isComplexType, _raise_linalgerror_singular
- )
312
+ )
313
+ except ImportError:
314
+ from numpy.linalg.linalg import (
315
+ _makearray, _assert_stacked_2d, _assert_stacked_square,
316
+ _commonType, isComplexType, _raise_linalgerror_singular
317
318
from numpy.linalg import _umath_linalg
319
320
a, _ = _makearray(a)
0 commit comments