Skip to content

Commit

Permalink
remove deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
boeddeker committed Jun 17, 2024
1 parent 21f31f6 commit c82be34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paderbox/math/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def stable_solve(A, B, rcond=-1):
assert A.shape[-1] == B.shape[-2], (A.shape, B.shape)
try:
return np.linalg.solve(A, B)
except np.linalg.linalg.LinAlgError:
except np.linalg.LinAlgError:
shape_A, shape_B = A.shape, B.shape
assert shape_A[:-2] == shape_A[:-2]
working_shape_A = [functools.reduce(operator.mul, [1, *shape_A[:-2]]),
Expand All @@ -116,6 +116,6 @@ def stable_solve(A, B, rcond=-1):
# lstsq is much slower, use it only when necessary
try:
C[i] = np.linalg.solve(A[i], B[i])
except np.linalg.linalg.LinAlgError:
except np.linalg.LinAlgError:
C[i], *_ = np.linalg.lstsq(A[i], B[i], rcond=rcond)
return C.reshape(*shape_B)

0 comments on commit c82be34

Please sign in to comment.