Skip to content

Commit

Permalink
lint: appease pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Oct 3, 2023
1 parent fc58bf8 commit bc9f28b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchopt/linalg/ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ def _ns_inv(A: torch.Tensor, maxiter: int, alpha: float | None = None) -> torch.
# A^{-1} = a [I - (I - a A)]^{-1} = a [I + (I - a A) + (I - a A)^2 + (I - a A)^3 + ...]
M = I - alpha * A
for rank in range(maxiter):
# pylint: disable-next=not-callable
inv_A_hat = inv_A_hat + torch.linalg.matrix_power(M, rank)
inv_A_hat = alpha * inv_A_hat
else:
# A^{-1} = [I - (I - A)]^{-1} = I + (I - A) + (I - A)^2 + (I - A)^3 + ...
M = I - A
for rank in range(maxiter):
# pylint: disable-next=not-callable
inv_A_hat = inv_A_hat + torch.linalg.matrix_power(M, rank)
return inv_A_hat

Expand Down

0 comments on commit bc9f28b

Please sign in to comment.