Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ig-dolci committed Mar 18, 2024
1 parent 4616f3f commit 6ef3dae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pyadjoint/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ def process_operation(self, cp_action, bar, **kwargs):
def _(self, cp_action, bar, functional=None, **kwargs):
for step in cp_action:
if self.mode == Mode.RECOMPUTE:
bar.next()
try:
bar.next()
except AttributeError:
pass
# Get the blocks of the current step.
current_step = self.tape.timesteps[step]
for block in current_step:
Expand Down Expand Up @@ -290,7 +293,10 @@ def _(self, cp_action, bar, functional=None, **kwargs):
@process_operation.register(Reverse)
def _(self, cp_action, bar, markings, functional=None, **kwargs):
for step in cp_action:
bar.next()
try:
bar.next()
except AttributeError:
pass
# Get the blocks of the current step.
current_step = self.tape.timesteps[step]
for block in reversed(current_step):
Expand Down

0 comments on commit 6ef3dae

Please sign in to comment.