Skip to content

Commit

Permalink
examples: add source as optional input for checkpointing that runs fo…
Browse files Browse the repository at this point in the history
…rward
  • Loading branch information
mloubout committed Oct 5, 2021
1 parent a7d3b38 commit 624e3ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/seismic/acoustic/wavesolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def adjoint(self, rec, srca=None, v=None, model=None, **kwargs):
dt=kwargs.pop('dt', self.dt), **kwargs)
return srca, v, summary

def jacobian_adjoint(self, rec, u, v=None, grad=None, model=None,
def jacobian_adjoint(self, rec, u, src=None, v=None, grad=None, model=None,
checkpointing=False, **kwargs):
"""
Gradient modelling function for computing the adjoint of the
Expand Down Expand Up @@ -200,7 +200,8 @@ def jacobian_adjoint(self, rec, u, v=None, grad=None, model=None,
time_order=2, space_order=self.space_order)
cp = DevitoCheckpoint([u])
n_checkpoints = None
wrap_fw = CheckpointOperator(self.op_fwd(save=False), src=self.geometry.src,
wrap_fw = CheckpointOperator(self.op_fwd(save=False),
src=src or self.geometry.src,
u=u, dt=dt, **kwargs)
wrap_rev = CheckpointOperator(self.op_grad(save=False), u=u, v=v,
rec=rec, dt=dt, grad=grad, **kwargs)
Expand Down

0 comments on commit 624e3ba

Please sign in to comment.