From 130c5d1c1e68e776d5e6540be4ff6f5f38a152a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 May 2023 11:44:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- python/taichi/linalg/matrixfree_cg.py | 4 ++-- python/taichi/linalg/sparse_cg.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/taichi/linalg/matrixfree_cg.py b/python/taichi/linalg/matrixfree_cg.py index 6af5ef177c387..0d333f4bbcea0 100644 --- a/python/taichi/linalg/matrixfree_cg.py +++ b/python/taichi/linalg/matrixfree_cg.py @@ -18,7 +18,7 @@ def matvec(self, x, Ax): def MatrixFreeCG(A, b, x, tol=1e-6, maxiter=5000, quiet=True): """Matrix-free conjugate-gradient solver. - + Use conjugate-gradient method to solve the linear system Ax = b, where A is implicitly represented as a LinearOperator. @@ -30,7 +30,7 @@ def MatrixFreeCG(A, b, x, tol=1e-6, maxiter=5000, quiet=True): atol: Tolerance(absolute) for convergence. quiet (bool): Switch to turn on/off iteration log. """ - + if b.dtype != x.dtype: raise TaichiTypeError(f"Dtype mismatch b.dtype({b.dtype}) != x.dtype({x.dtype}).") if str(b.dtype) == "f32": diff --git a/python/taichi/linalg/sparse_cg.py b/python/taichi/linalg/sparse_cg.py index 5ebdf663f5ca9..e0aba8112c690 100644 --- a/python/taichi/linalg/sparse_cg.py +++ b/python/taichi/linalg/sparse_cg.py @@ -8,7 +8,7 @@ class SparseCG: """Conjugate-gradient solver built for SparseMatrix. - + Use conjugate-gradient method to solve the linear system Ax = b, where A is SparseMatrix. Args: @@ -18,7 +18,7 @@ class SparseCG: max_iter (int): Maximum number of iterations. atol: Tolerance(absolute) for convergence. """ - + def __init__(self, A, b, x0=None, max_iter=50, atol=1e-6): self.dtype = A.dtype self.ti_arch = get_runtime().prog.config().arch