Skip to content

Commit

Permalink
Updated '.../torchmin/trustregion/exact.py:67' to resolve the followi…
Browse files Browse the repository at this point in the history
…ng warning:

"UserWarning: torch.triangular_solve is deprecated in favor of torch.linalg.solve_triangularand will be removed in a future PyTorch release.
torch.linalg.solve_triangular has its arguments reversed and does not return a copy of one of the inputs.
X = torch.triangular_solve(B, A).solution
should be replaced with
X = torch.linalg.solve_triangular(A, B)."
  • Loading branch information
ahenkes1 committed May 5, 2023
1 parent e1af11f commit 2154d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchmin/trustregion/exact.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _minimize_trust_exact(fun, x0, **trust_region_options):


def solve_triangular(A, b, **kwargs):
return torch.triangular_solve(b.unsqueeze(1), A, **kwargs)[0].squeeze(1)
return torch.linalg.solve_triangular(A, b.unsqueeze(1), **kwargs)[0].squeeze(1)


def solve_cholesky(A, b, **kwargs):
Expand Down Expand Up @@ -388,4 +388,4 @@ def solve(self, tr_radius):
self.lambda_current = lambda_current
self.previous_tr_radius = tr_radius

return p, hits_boundary
return p, hits_boundary

0 comments on commit 2154d80

Please sign in to comment.