Skip to content

Commit

Permalink
Minor fix in TAOSolver.solve
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmaddison committed Jul 19, 2024
1 parent a693934 commit 33cda51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tlm_adjoint/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,10 @@ def solve(self, M):
x = self._vec_interface.new_vec()
x.to_petsc(M)

self._M[0] = tuple(var_new(m, static=var_is_static(m),
cache=var_is_cached(m))
for m in M)
try:
self._M[0] = tuple(var_new(m, static=var_is_static(m),
cache=var_is_cached(m))
for m in M)
self.tao.solve(x.vec)
finally:
self._M[0] = None
Expand Down

0 comments on commit 33cda51

Please sign in to comment.