Skip to content

Commit ec82589

Browse files
committed
fix: change atol behaviour for cg
1 parent 2a94687 commit ec82589

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pylops/optimization/cls_leastsquares.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def run(
219219
and cupy `data`, respectively)
220220
221221
.. note::
222-
When user does not supply ``atol``, it is set to "legacy".
222+
When user supplies ``tol`` this is set to ``atol``.
223223
224224
Returns
225225
-------
@@ -238,8 +238,9 @@ def run(
238238
if x is not None:
239239
self.y_normal = self.y_normal - self.Op_normal.matvec(x)
240240
if engine == "scipy" and self.ncp == np:
241-
if "atol" not in kwargs_solver:
242-
kwargs_solver["atol"] = "legacy"
241+
if "tol" in kwargs_solver:
242+
kwargs_solver["atol"] = kwargs_solver["tol"]
243+
kwargs_solver.pop("tol")
243244
xinv, istop = sp_cg(self.Op_normal, self.y_normal, **kwargs_solver)
244245
elif engine == "pylops" or self.ncp != np:
245246
if show:

0 commit comments

Comments
 (0)