Skip to content

Commit

Permalink
Fix stepper division by zero
Browse files Browse the repository at this point in the history
fixes #34
  • Loading branch information
gmertes committed Mar 6, 2024
1 parent c098534 commit 08ef357
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ai_models/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def __call__(self, i, step):
self.last = now

def __exit__(self, *args):
if self.num_steps == 0:
return

elapsed = time.time() - self.start
LOG.info("Elapsed: %s.", seconds(elapsed))
LOG.info("Average: %s per step.", seconds(elapsed / self.num_steps))

0 comments on commit 08ef357

Please sign in to comment.