Skip to content

Commit

Permalink
fix: change atol behaviour for cg
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Jul 2, 2024
1 parent 2a94687 commit ec82589
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pylops/optimization/cls_leastsquares.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def run(
and cupy `data`, respectively)
.. note::
When user does not supply ``atol``, it is set to "legacy".
When user supplies ``tol`` this is set to ``atol``.
Returns
-------
Expand All @@ -238,8 +238,9 @@ def run(
if x is not None:
self.y_normal = self.y_normal - self.Op_normal.matvec(x)
if engine == "scipy" and self.ncp == np:
if "atol" not in kwargs_solver:
kwargs_solver["atol"] = "legacy"
if "tol" in kwargs_solver:
kwargs_solver["atol"] = kwargs_solver["tol"]
kwargs_solver.pop("tol")
xinv, istop = sp_cg(self.Op_normal, self.y_normal, **kwargs_solver)
elif engine == "pylops" or self.ncp != np:
if show:
Expand Down

0 comments on commit ec82589

Please sign in to comment.